Upgrade to Pro — share decks privately, control downloads, hide ads and more …

APIs seguras com OAuth2

Tony Messias
December 18, 2014

APIs seguras com OAuth2

Uma introdução simplificada dos principais conceitos do OAuth2 para o segundo encontro do Maceió DEV Meetup!

Tony Messias

December 18, 2014
Tweet

More Decks by Tony Messias

Other Decks in Programming

Transcript

  1. POST /resources HTTP/1.1 Host: api.example.com Authorization: OAuth oauth_consumer_key=" lWsZaXcyujT8ErqdIlbr0Sn9LaFYNlE2eVCczyvsFKnmBHiBnVrY3xo64 ByB",

    oauth_nonce="0Sn9LaFYN", oauth_signature=" lWsZaXcyujT8ErqdIlbr0Sn9LaFY", oauth_signature_method=" HMAC-SHA1", oauth_timestamp="1418836421", oauth_token=" 96403f692107210ef11f4a02cdbce4af", oauth_version="1.0" Content-Type: application/json { "lorem" : "ipsum" }
  2. POST /resources HTTP/1.1 Host: api.example.com Authorization: OAuth oauth_consumer_key=" lWsZaXcyujT8ErqdIlbr0Sn9LaFYNlE2eVCczyvsFKnmBHiBnVrY3xo64 ByB",

    oauth_nonce="0Sn9LaFYN", oauth_signature=" lWsZaXcyujT8ErqdIlbr0Sn9LaFY", oauth_signature_method=" HMAC-SHA1", oauth_timestamp="1418836421", oauth_token=" 96403f692107210ef11f4a02cdbce4af", oauth_version="1.0" Content-Type: application/json { "lorem" : "ipsum" }
  3. Bob é redirecionado de volta para a aplicação com um

    código https://oauth2client.com/callback?code=AUTH_CODE_HERE