-
Notifications
You must be signed in to change notification settings - Fork 57
authentication airport analogy blog #3792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
kmaida
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only reviewed the analogy itself; not an editorial review.
| - The client application is the airport. | ||
| - The Authorization Server is the TSA (Transportation Security Administration). If you are from outside of the United States, you can just think of this as airport security. The airline is also considered part of the authorization server here because they are the ones that issue the boarding pass. | ||
| - The Access Token is the boarding pass. | ||
| - The resource server is the gate your plane leaves from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the resource server the airplane itself? You can get to the gate without a boarding pass, but you can't board the plane without a pass.
|
|
||
| - The user is represented by you (a traveler). | ||
| - The client application is the airport. | ||
| - The Authorization Server is the TSA (Transportation Security Administration). If you are from outside of the United States, you can just think of this as airport security. The airline is also considered part of the authorization server here because they are the ones that issue the boarding pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+Passport is like a password or auth factor. It's a thing you use to authenticate (i.e., prove you are who you say you are)
|
|
||
| You (the user) wake up early, caffeinate appropriately, and head to the airport. You've got a destination in mind, let's say maybe beautiful Colorado. You can't just show up and expect to walk straight onto a plane. First, you interact with the airport, our stand-in for the client application. The airport is the one coordinating the trip on your behalf. They know which flight you're taking, what time you need to check in, and where to direct you. They manage the process of getting you to your destination. | ||
|
|
||
| When it's time to go through security, the airport directs you to the TSA, which represents the authorization server in our metaphor. This is the critical gatekeeper responsible for verifying your identity. Behind the scenes, the airport has agreed to trust the TSA. You hand over your credentials, usually a government-issued ID and your boarding pass. You can think of the boarding pass as your requested scopes for access to the gates. The TSA doesn't care which airline you flew with last week, they just want to validate that you are you, and that you're permitted to travel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe specify that this process is authentication.
|
|
||
| When it's time to go through security, the airport directs you to the TSA, which represents the authorization server in our metaphor. This is the critical gatekeeper responsible for verifying your identity. Behind the scenes, the airport has agreed to trust the TSA. You hand over your credentials, usually a government-issued ID and your boarding pass. You can think of the boarding pass as your requested scopes for access to the gates. The TSA doesn't care which airline you flew with last week, they just want to validate that you are you, and that you're permitted to travel. | ||
|
|
||
| Once you pass that check, TSA has verified that you are you and you can proceed to the restricted resource. In this case the gates. The analogy breaks down a bit here as the boarding pass now becomes our metaphorical access token and was issued by the airlines and not the TSA. For the purpose of this analogy, We'll lump the TSA and the airline check-in counter into one metaphorical group we'll call 'security & validation.' Together, they handle verifying your identity, issuing your pass, and ensuring you're legit to board. The combination could even be considered multi-factor authentication. In the real authentication flow the authentication server would issue a JWT, which is the actual token used in the authentication flow. This token contains information about who you are, where you're going, and what you're allowed to access. Maybe you're seated in economy or maybe you've got gold status and access to all the snacks and reclining chairs. That's encoded in the token. It's signed, tamper-proof, and TSA doesn't need to follow you around anymore. They trust the pass to do the job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the analogy breaks down. What happens is authentication and then the first level of authorization.
Check-in: authentication (prove you are who you say you are; passport is an authentication factor, in this particular analogy)
Security: authorization 1 (access into the secured area of the airport)
Boarding: authorization 2 (access to the plane)
| import AuthenticationCodeFlow from 'src/diagrams/blog/authorization-airport-analogy/authentication-code-flow.astro'; | ||
| import AirportCodeFlow from 'src/diagrams/blog/authorization-airport-analogy/authentication-code-flow-airport-analogy.astro'; | ||
|
|
||
| Many blogs on authentication and authorization are often very technical in nature. Recently, at an event dedicated to real world ID, I was pondering the connection between the authorization flows and the real world. After talking with someone who was not technical but well versed in real world applications of identity, I tried to explain the authorization flow in a real world example he may be able to more easily understand. I think I came up with a pretty good analogy. (In all honesty, the one I came up with initially was pretty terrible. After thinking about it a bit, I came up with this one that I think is good.) Hopefully if you're not technical or into authentication, this will give you a basic understanding of the flow. If you are technical, this can give you a way to explain what you do to your family and friends at the next holiday gathering. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, the whole analogy could fit into a couple of sentences. I'd remove most of this intro, as it's setup that isn't particularly relevant to the message you want the reader to take away.
|
@mark-robustelli can you please give this PR a better name than "initial commit" :) |
No description provided.