things to talk about: Cookies vs JWT
http://www.oauthforaspnet.com/
OAuth http://oauth.net http://oauth.net/2/
JWT Simple - node library to encode/decode tokens.
Json web token: Has 3 parts. Header, Claims, Signiture
Securtiy Token Service (STS)
- Client: Open a popup window via
$auth.authenticate('provider name')
. - Client: Unlike OAuth 2.0, you cannot go directly to the authentication screen without a valid request token.
- Client: The OAuth 1.0 flow starts with the GET request to /auth/provider inside the popup.
- Server: Check if URL contains
oauth_token
andoauth_verifier
parameters. - Sever: Initially it does not, so send an OAuth signed POST request to the /request_token URL.
- Server: Redirect to the /authenticate URL with a valid request token.
- Client: Sign in with your username and password if necessary, then authorize the application.
- Client: Send a GET request back to the /auth/provider with
oauth_token
andoauth_verifier
query string parameters. - Server: Similar to Step 4, but this time send an OAuth signed
POST
request to the /access_token URL since we now haveoauth_token
andoauth_verifier
parameters. - Server: Look up the user by their unique Provider ID. If user already exists, grab the existing user, otherwise create a new user account.
- Server: Create a JSON Web Token and send it back to the client.
- Client: Parse the token and save it to Local Storage for subsequent use after page reload.
Some services that support Oauth 1.0 include:
OAuth 2 - The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service.
- Client: Open a popup window via
$auth.authenticate('provider name')
. - Client: Sign in with that provider, if necessary, then authorize the application.
- Client: After successful authorization, the popup is redirected back to
your app, e.g. http://localhost:3000, with the
code
(authorization code) query string parameter. - Client: The
code
parameter is sent back to the parent window that opened the popup. - Client: Parent window closes the popup and sends a POST
request to /auth/provider with
code
parameter. - Server: Authorization code is exchanged for access token.
- Server: User information is retrived using the access token from Step 6.
- Server: Look up the user by their unique Provider ID. If user already exists, grab the existing user, otherwise create a new user account.
- Server: In both cases of Step 8, create a JSON Web Token and send it back to the client.
- Client: Parse the token and save it to Local Storage for subsequent use after page reload.
- Dropbox
- Facebook Graph API
- GitHub
- Windows Live
- Client: Enter your email and password into the signup form.
- Client: On form submit call
$auth.signup()
, passing an object with email and password. - Client: Send a
POST
request to the /auth/signup. - Server: Create a new user account then reply with
200 OK
. - Client: Redirect to the
signupRedirect
route. Default:/login
.
- Client: Delete
satellizer_token
from Local Storage. - Client: Redirect to the
logoutRedirect
route. Default:/
.
- oauth.io (Free up to 500 API calls/month)
- auth0.com (AD integration)
Satellizer is simple to use, end-to-end, token-based authentication module for AngularJS. It has built in support for many popular public services such as Google, Facebook, LinkedIn, Twitter, Yahoo, Windows Live authentication, as well as email/password sign in. You can add any OAuth 1.0 or 2.0 provider. Jwt.io
Grant - OAuth middleware for Express, Koa
Authentication vs Authorization MustBe
http://www.ndcvideos.com/#/app/video/2651
"SAML is the Windows XP of Identity" it has no future. Heavy handed. OAuth2 is not an authentication protocol?!?
What we have now is a 'flavor of OAuth from Twitter, from Facebook, from Google, you name it'
OAuth was really just designed for creating access tokens and passing them along and has morphed into and authentication protocol
OpenID Connect 1.0 is a simple identity layer on top of the OAuth 2.0 protocol "simple to use as a consumer, but not so simple to implement" - db
oauth never specified a token type. OpenID does. OpenID Connect design goals include standard token types, standard encryption, how to validate tokens, combines authentication and access control in a single protocol. Single round trip to server.