Authentication and Authorization
Web Authentication Methods:
- HTTP Basic Authentication
- HTTP Digest Authentication
- Session-based Auth
- Token-Based Authentication
- One Time Passwords
- OAuth and OpenID
Detailed blog: here and video here(Tested with Postman)
HTTP is a stateless protocol.So you need to store state using session(cookies) or tokens.
Using Sessions the state is stored in the server side and sent to the clinet in response header.So when client want to talks to the server then again this session information needed to be sent using cookies.
It work fine for smal applications which are hosted on single host, but when your appliation is large and requires a load balancing solution we need to store that session information in common location eg:Redis.
In order to avaoid this, JWT token info in the client side only.So there is no overhead of maintaining state information on the server side
JWT:(JSON Web Token)
* Best video on internet: video1, what is JWT and why we need it
* Diff between Sessions Cookes and JWT tokens, read here(vvvv IMP)
* JWT structure video2
OAUTH:
* best video: here, terminology and flow video here
Blog on Oauth2: here
API Authentication types:
- HTTP Authentication Schemes (Basic & Bearer)
- API Keys
- OAuth (2.0)
- OpenID Connect
Details of 4 in detail: here
- Bearer token was initially used in Oauth2.0 (Last step after 8 in pic). Later this concept was individually used(We can create token after login into application eg: Github and artifactory etc)
More details: here
Nice video: here
Comments
Post a Comment