Prefer a video instead? Watch this quick video where Anthony takes on a quest to get through the Authorization Code Flow in a retro-style rpg game.
I'm transformed into a character in a retro style RPG game, or my quest is to take a photo of your paying water while the game will have characters that represent each role in the Oaut Grant.
Here are the characters, there's that he shows up as my guide.
Now there's no guide Oaut Grant but his place in this analogy is explain the spec by guiding me through my quest.
Lee, you're the resource owner, Aaron is the authorized endpoint of the authorization server.
Emily is the token endpoint of the authorization server, Jordan is the resource server.
The protected resources you bring water bottle, lastly, I'm the client.
[MUSIC] The first thing I do when I start the game is head over to the resource owner and get my quest, photograph your ping water bottle.
[MUSIC] Before I can head off to snap a picture of your water bottle, I need some way to prove you've authorized my axis to get past the first guardian on the path, the token endpoint.
So you head over to Aaron the authorized endpoint, you authenticate with her and she gives you a code bring back to me.
[MUSIC] Now with this authorization code, I can hit on the see Emily, the token endpoints [MUSIC] Noa advises me that I can only get pastor if I provide proof of your authorization in the form of an authorization code.
And we don't just let anyone through invents every code to make sure it's legitimate.
And she also checks for the scope of access that the code allows for lucky for me, I have the right code to show to Emily.
She verifies it and gives me an access token, so I continue on.
Next, I head to the resource server.
[MUSIC] Now Ed explains I need to show the access token to the resource server to be allowed in to take a photo of the pink water bottle.
Jordan doesn't allow anyone pass her without first checking for proof of your authorization.
She does so by asking for an access token and verify it.
The token must allow for access to the water bottle, so I'll show you the token, she verifies everything checks out, so she lets me in.
[MUSIC] Now I have access to the water bottle and I can complete my quest.
[MUSIC] What do you think?
>> That sounds really weird.
[MUSIC]
There are four grant types in OAuth 2.0, and, by the end of this blog, you will have a better understanding of one of the most commonly used types: the Authorization Code Grant Type (Auth Code).
There’s a particular flow, or path, to follow, and my goal in writing this post is to give you a good understanding of the flow forwards and backwards. Or rather, a good understanding of it backwards and forwards—because I’ll step through the Auth Code flow starting from the end.
Learning the flow backwards gives you a better idea of what problem we’re trying to solve rather than focusing in on each particular step without understanding why those steps are taken. The process is important, but knowing the problem and solution at the outset can help us understand why the particular process came about, and we’ll have a much stronger understanding of the flow because of it. So first we will look, in reverse order, at the steps that might immediately lead to the desired outcome.