OpenID Connect is a layer on top of OAuth introduced in 2015. The success of OpenID Connect is that it returns the simple JSON-based identity tokens (JWT) {pronounced as Jawt} signed by the OpenID provider (OP) through OAuth protocol to suit web, mobile, and browser-based applications. In comparison to OAuth, Open ID Connect actually tells about the user's identity information and instead of getting the access details, it tells exactly about the user accessing a resource. Consider the following diagram:
We can relate an Identity token to a driving license that contains driver information such as license number, license expiry, first name, last name, type of vehicle permitted, and so on.
The Identity token is encoded into the base 64 URL-safe string that contains information such as subject (sub), issuing authority (iss), audience (aud), and more. It may also contain some extra...