Skip to content

Instantly share code, notes, and snippets.

@wkrueger
Last active November 18, 2019 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkrueger/00117664863d385f9a0ce98e465c8881 to your computer and use it in GitHub Desktop.
Save wkrueger/00117664863d385f9a0ce98e465c8881 to your computer and use it in GitHub Desktop.
oauth

Fluxos do oauth

Flow Application
Authorization Code 1st party apps
3rd party apps
(R. Owner's) Password Credentials 1st party apps
Implicit SPA's (google fonts)
Client credentials Daemons

Password credentials

  • O app pode ver senha do usuário.
user:        username+password  ->  app
app:         username+password + app ID  ->  auth_server
auth_server: access_token + refresh_token  ->  app

Authorization code

  • Redirect com código intermediário
app:         browser link to auth server  ->  user
user:        username+password  -> browser  ->  auth_server
auth_server: browser link to app with auth_code  ->  user  ->  app
app:         auth_code  ->  auth_server
auth_server: access_token + refresh_token  ->  app

Implicit

  • Mesmo que o fluxo "authorization code", mas sem o código intermediário auth_code;
  • O access_token é passado direto pro app no callback;
  • Não há refresh_token;

Client credentials

  • App dá client_id e client_secret pro servidor e tem acesso a tudo;
  • Só dá acesso a dados globais (afinal, o usuário não autenticou)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment