Validate ID tokens | Okta Developer (2024)

On this page

This guide explains how to validate ID tokens with Okta.

Learning outcomes

  • Retrieve and parse your Okta JSON Web Keys (JWK).
  • Decode the ID token.
  • Verify the signature that was used to sign the ID token.
  • Verify the claims in the ID token.

About ID token validation

If your client app requires authentication and would like to obtain information about the authenticated person, then it should use the OpenID Connect (OIDC) protocol to get an ID token.

OIDC is an authentication protocol built on top of OAuth 2.0. With OAuth 2.0, a user can authenticate with an authorization server and provide you with an access token that authorizes access to some server resources. With OIDC, they can also give you a token called an ID token. The ID token contains information about a user and their authentication status. Your client can use the token for both authentication and as a store of information about that user. One OIDC flow can return both access and ID tokens.

ID tokens vs access tokens

The ID token is a security token granted by the OpenID provider that contains information about an end user. This information tells your client app that the user is authenticated, and can also give you information like their username or location.

You can pass an ID token to different components of your client. These components can use the ID token to confirm that the user is authenticated and also to retrieve information about them.

Access tokens, on the other hand, aren't intended to carry information about the user. They allow access to certain defined server resources. See Validate access tokens.

What to check when validating an ID token

The following is a high-level overview of validating an ID token:

  • Retrieve and parse your Okta JSON Web Keys (JWK), which should be checked periodically and cached by your app.
  • Decode the ID token, which is in JWK format.
  • Verify the signature used to sign the ID token.
  • Verify the claims found inside the ID token.

Retrieve the JSON Web Key Set

Retrieve the JSON Web Key Set (JWKS) from your Okta authorization server. Your app may have it cached. Specifically, your authorization server's Metadata endpoint contains the jwks_uri, which you can use to get the JWKS.

Note: See Retrieve authorization server metadata (opens new window).

Decode the ID token

Decode the ID token, which is in JSON Web Token (JWT) format, to use it. See the list of libraries that are available to help you do this.

Verify the token signature

Verify the access or ID token's signature by matching the key that was used to sign in with one of the keys that you retrieved from your Okta authorization server's JWK endpoint. Specifically, a kid attribute is used to identify each public key, which corresponds with the kid claim in the access or ID token header.

If the kid claim doesn't match, it's possible that the signing keys have changed. Check the jwks_uri value in the authorization server metadata and try retrieving the keys again from Okta.

Verify the claims

Verify the following:

  • The iss (issuer) claim matches the identifier of your Okta authorization server.
  • The aud (audience) claim should match the client ID that you used to request the ID token. This is the client ID for the app that you created in Okta.
  • The iat (issued at time) claim indicates when this ID token was issued, expressed in Unix time.
  • The exp (expiry time) claim is when this token expires, expressed in Unix time. Make sure that this time hasn't already passed.
  • The nonce claim value should match whatever was passed when you requested the ID token.

Validate a token remotely with Okta

You can also validate an ID token using the Token Introspection endpoint (opens new window). This endpoint takes your token as a URL query and returns a JSON response with a boolean active property. If active is true, then more information about the token is also returned.

This method incurs a network request that results in slower verification of the token. Use this method when you want to guarantee that the access token hasn't been revoked.

Okta Libraries to help you verify ID tokens

The Okta JWT verifier is available for the following languages:

See also

Validate ID tokens | Okta Developer (2024)
Top Articles
Token Economies In Applied Behavior Analysis - Eyas Landing
Is $1 Million Enough to Retire at 55? | SoFi
What Is Single Sign-on (SSO)? Meaning and How It Works? | Fortinet
Yogabella Babysitter
Osrs But Damage
Anki Fsrs
Globe Position Fault Litter Robot
Uvalde Topic
Otr Cross Reference
Chastity Brainwash
Persona 4 Golden Taotie Fusion Calculator
More Apt To Complain Crossword
UEQ - User Experience Questionnaire: UX Testing schnell und einfach
Nwi Arrests Lake County
Les Rainwater Auto Sales
Gia_Divine
Nevermore: What Doesn't Kill
I Saysopensesame
Acts 16 Nkjv
Dragger Games For The Brain
Craigslist Alo
Target Minute Clinic Hours
Darrell Waltrip Off Road Center
Craigslist Pasco Kennewick Richland Washington
Geico Car Insurance Review 2024
Harrison 911 Cad Log
Jailfunds Send Message
Movies - EPIC Theatres
Stubhub Elton John Dodger Stadium
Ancestors The Humankind Odyssey Wikia
Worlds Hardest Game Tyrone
Gabrielle Enright Weight Loss
Makemkv Key April 2023
Teenage Jobs Hiring Immediately
RUB MASSAGE AUSTIN
Troy Gamefarm Prices
Uc Santa Cruz Events
Frommer's Philadelphia & the Amish Country (2007) (Frommer's Complete) - PDF Free Download
Prior Authorization Requirements for Health Insurance Marketplace
11301 Lakeline Blvd Parkline Plaza Ctr Ste 150
Noaa Marine Weather Forecast By Zone
Express Employment Sign In
Jasgotgass2
Emily Tosta Butt
18006548818
56X40X25Cm
Suntory Yamazaki 18 Jahre | Whisky.de » Zum Online-Shop
Vci Classified Paducah
Steam Input Per Game Setting
Pelican Denville Nj
Jasgotgass2
Latest Posts
Article information

Author: Margart Wisoky

Last Updated:

Views: 5866

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Margart Wisoky

Birthday: 1993-05-13

Address: 2113 Abernathy Knoll, New Tamerafurt, CT 66893-2169

Phone: +25815234346805

Job: Central Developer

Hobby: Machining, Pottery, Rafting, Cosplaying, Jogging, Taekwondo, Scouting

Introduction: My name is Margart Wisoky, I am a gorgeous, shiny, successful, beautiful, adventurous, excited, pleasant person who loves writing and wants to share my knowledge and understanding with you.