Difference between OpenID Connect and OAuth 2.0

I introduced you to OAuth 2.0 and OAuth 2.0 is just a framework related to Authorization, that is, it only defines what resources a Client Application can use, in the access token, so that when requesting to the Resource Server, Resource Server will base on the access token to decide whether to allow Client Application access to the resource or not?

But talking about security, you may know, we also have authentication and OpenID Connect is an extension of OAuth 2.0 introduced to add this authentication. Using OpenID Connect, the content of the access token that the Client Application uses to request to the Resource Server will include information about the user granting access to these resources.

In OpenID Connect, the Authorization Server is called the Identity Provider. Identity Provider will take care of authentication and authorization functions.

The access token is issued by an Identity Provider as I said, will contain information of the authenticated user, this information is called Identity Token or ID token for short.

Here is the content of an access token that I decoded using the website https://jwt.io/:

The content below the claim ‘scope’, which I marked in the access token above, is the content of that ID token. You can see this is the information about the logged-in user and granted access to the Client Application. You can see the standard claims of ID tokens here.

Current open-source Identity and Access Management such as Keycloak, implement OpenID Connect, not just OAuth 2.0.

Add Comment