-
SSO - Single Sign-On
-
OAuth is an open-standard authorization protocol/framework that details how unrelated servers and services can safely allow authenticated access to their assets without actually sharing the original logon credential.
- AKA secure 3rd party user-agent, delegated authorization
- an example of this is when a website allows you to login using your google account
-
OAuth only works using HTTPS
-
How OAuth Works
- website (A) connects to website (B) on behalf of user using OAuth
- website (B) generates a single use request token and secret
- website (A) provides request token and secret to user's client software
- client software presents request token and secret to to authorization provider
- if not authenticated, client is asked to authenticate then client is asked to approve authorization transaction to website (B)
- user approves transaction at website (A)
- user gets approved access token
- user gives approved access token to website (A)
- website (A) gives approved access token to website (B) as proof of user authentication
- website (B) allows website (A) to access site on behalf of user
- user see successful transaction
-
OpenID is about authentication, where OpenID Connect is now an authentication layer for OAuth
-
Summary by StackOverflow user pithily: "OpenID is for humans logging into machines, OAuth is for machines logging into machines on behalf of humans."
-
Authentication is the process of a user/subject proving its ownership of a presented identity, by providing a password or some other uniquely owned or presented factor.
-
Authorization is the process of letting a subject access resources after a successful authentication, oftentimes somewhere else.
-
Authorization Code Flow - exchanges Authorization for a token for server-side apps
-
Authorization Code Flow with Proof Key for Code Exchange (PKCE) - Authorization Code Flow for mobile and native applications Implicit Flow with Form Post - alternative to Authorization Code Flow for Public Clients (not best practice) Client Credentials Flow - Machine to Machine (M2M) authentication and authorization Device Authorization Flow - device asks user to authenticate via a link on computer or smartphone Resource Owner Password Flow - credentials provided via form (not recommended)