Top

OAuth 2.0 and OpenID Connect For Dummies

Oath 2.0 and OpenID Connect

OAuth 2.0 and OpenID Connect For Dummies

Many of us struggle with this subject. What’s up with that? And what are those, anyway?

Intro

Authentication 101

(The amazing doodles in this post are made by my dear friend Kim)

This is what implementing authentication used to be like. Photo by Jeremy Bezanger on Unsplash

We Have Protocols for This

OAuth

The Terminology

The Authorization Code Flow

Scope

Back Channel and Front Channel

GET https://accounts.google.com/o/oauth/v2/auth?client_id=stav123&redirect_uri=https://stav.com/callback&scope=profile&response_type=code&state=foobar
POST www.googleapis.com/oauth2/v4/token
Content-Type: application/x-www-form-urlencodedcode=oGd5GkJs5mKrtgH5&
client_id=stav123
client_secret=stav_secret_123&
grant_type=authorization_code
{
  "access_token": "FgrgGsd456GdSghDsgsa3fHg",
  "expires_in: 4560,
  "token_type": "Bearer"
}
GET api.google.com/whatever
Authorization: Bearer FgrgGsd456GdSghDsgsa3fHg

Other Possible Flows

OAuth For Authentication?

OpenID Connect

OpenID Connect Authorization Code Flow

JWT

This example is taken from https://connect2id.com/learn/openid-connect which is a great source of learning.
Taken from https://jwt.io/introduction — also a great source of learning!

Let’s Take a Short Break

Refresh Token

End of Short Break

Memes are taken from http://www.memeking.co.il/

Summary

 

Also posted in Medium

stavbarak
No Comments

Post a Comment