What is JSON Web Token and when its needed? It is a self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed and encrypted to also provide secrecy between parties (Signed Tokens - Integrity and Encrypted Tokens - Hide). JWT needs for: Authentication - Once the user is logged in, each subsequent request will include the JWT, allowing the user to access routes, services, and resources that are permitted with that token. Information Exchange - Using public/private key pairs—you can be sure the senders are who they say they are. Additionally, as the signature is calculated using the header and the payload, you can also verify that the content hasn't been tampered with. JWT Structure: In its compact form, JSON Web Tokens consist of three parts separated by dots ( . ), which are: Header Payload Signature Therefore, a JWT typically looks like the...
As I said in the previous blog about OIDC, OIDC is running on top of OAuth in-order to provide authentication and authorization. When it comes to real scenario, we have need to clearly understand the flows between authorization server, and resource server. For OAuth it needs token introspection endpoint in-order to validate the token. But, in OIDC it doesn't need to have this introspection endpoint because OIDC response token (JWT) it contains the idtoken which contains information about the token to validate by the resource server. OIDC is running as authorization grant type is pretty much safe way for the web applications. Let's see how a real world application using this OIDC on top of OAuth. Note: I have created an sample application to provide the graphical interface for this explanation. When you are trying to login a online web application account you may see another login options also available. For example, login with Google, login with Facebook,etc. Those ...