Search code examples
c#asp.net-corejwtaccess-token

Jwt token vs access token


I'm studing IdentityServer4 and I got question. I know that exist jwt token which need for checking token. It checks that token was gotten from trust server. There is access_token which need to authorize in app. How does it work? I get two tokens or jwt contains a access_token as well?


Solution

  • From an Auth Server(The server which issues the JWT token), you will received a JWT Token aka Access_Token. This Auth Server will contains the Secret-Key that can issues an Access-Token.

    From a client(Mobile/Web/Console App), you will need to pass this Access_Token in your Request Header to your Resource Server(The server where your resources stored, normally this is your backend server) to request for Resources/Data.

    (e.g : Authorization : Bearer <Access_Token>)

    Upon receives a request from client,in your Resource Server, you will need to have a Validate JWT function that will validate the JWT Token based on a public-key (Security Algorithm : RSA256, HS256).

    Reference: https://medium.com/dev-bits/a-guide-for-adding-jwt-token-based-authentication-to-your-single-page-nodejs-applications-c403f7cf04f4

    JWT IO Introduction