Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Written by Prashant Basnet
Prashant Basnet, a software engineer at Unisala.com, focuses on software development and enjoys building platforms to share knowledge. Interested in system design, data structures, and is currently learning NLP
Let's start from the basics.
What is Authentication and Authorization?
Authentication:
Process of verifying the identity of a user in the system, through credentials like usernames and passwords.This step ensures that the entity requesting access is who it claims to be.
Authorization:
Determines what an authenticated user is allowed to do. For eg: a user is allowed to edit their own post
1. Traditional authentication and authorization through Session Cookies:
Historically, authentication was often handled directly using session based management.
Session cookies required server to maintain session information which can become resources intensive with larger number of users.
Limitations:
Transition to OAuth: Necessity as the Mother of Invention
2. OAuth 1.0:
Introduced in 2007 as open standard for access delegation.User can grant a 3rd party application access to their information stored on another service without having to share their login credentials (username and password) for that service.
it used uses cryptographic signature in it's core
generate access token
/
user ---> credential ---> login
\
generate request token
It introduced communication workflow:
1. Obtaining request token
2. Redirecting the user to authenticate
3. Accessing request token for access token
4. Using access token to access the api
Limitations of OAuth 1.0:
was a significant step forward, it had a several drawbacks.
3. OAuth 2.0 :
To address these limitations, OAuth 2.0.It is authorization framework rather than authentication.It introduced :
Access token and refresh token in OAuth 2.0 address several key issues in web security and usability that arise than just using single token. The rationale 🧠 behind dual token centers around:
4. In modern web app, authentication and authorization uses tokens.
------------------------------------------------------------------------------------------------------------------------------
if a access token is compromised , then why would not the refresh token be?
since both lives in client side? 🧐 👀
------------------------------------------------------------------------------------------------------------------------------
Both access token and refresh token are indeed stored in the client side, but
which impacts their susceptibility to being compromised
Here's why?
To Conclude: So the dual token system in OAuth 2.0 consist of access token i.e short lived and refresh token i.e long lived. Which balances the need for security and user convenience with the system architecture.