ID tokens in the Microsoft identity platform - Microsoft identity platform (2024)

  • Article

ID tokens are a type of security token that serves as proof of authentication, confirming that a user is successfully authenticated. Information in ID tokens enables the client to verify that a user is who they claim to be, similar to name tags at a conference. The authorization server issues ID tokens that contain claims that carry information about the user. They can be sent alongside or instead of an access token, and are always JWT (JSON Web Token) format.

ID tokens differ from access tokens, which serve as proof of authorization. Confidential clients should validate ID tokens. You shouldn't use an ID token to call an API.

Third-party applications are intended to understand ID tokens. ID tokens shouldn't be used for authorization purposes. Access tokens are used for authorization. The claims provided by ID tokens can be used for UX inside your application, as keys in a database, and providing access to the client application. For more information about the claims used in an ID token, see the ID token claims reference. For more information about claims-based authorization, see Secure applications and APIs by validating claims.

Token formats

There are two versions of ID tokens available in the Microsoft identity platform: v1.0 and v2.0. These versions determine the claims that are in the token. The v1.0 and v2.0 ID tokens have differences in the information they carry. The version is based on the endpoint from where it was requested. New applications should use the v2.0.

  • v1.0: https://login.microsoftonline.com/common/oauth2/authorize
  • v2.0: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

Sample v1.0 ID token

eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjdfWnVmMXR2a3dMeFlhSFMzcTZsVWpVWUlHdyIsImtpZCI6IjdfWnVmMXR2a3dMeFlhSFMzcTZsVWpVWUlHdyJ9.eyJhdWQiOiJiMTRhNzUwNS05NmU5LTQ5MjctOTFlOC0wNjAxZDBmYzljYWEiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9mYTE1ZDY5Mi1lOWM3LTQ0NjAtYTc0My0yOWYyOTU2ZmQ0MjkvIiwiaWF0IjoxNTM2Mjc1MTI0LCJuYmYiOjE1MzYyNzUxMjQsImV4cCI6MTUzNjI3OTAyNCwiYWlvIjoiQVhRQWkvOElBQUFBcXhzdUIrUjREMnJGUXFPRVRPNFlkWGJMRDlrWjh4ZlhhZGVBTTBRMk5rTlQ1aXpmZzN1d2JXU1hodVNTajZVVDVoeTJENld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B1L9-ImX98Egypfrlbm0IBL5spFzL6JDZIRRJOu8vecJvj1mq-IUhGt0MacxX8jdxYLP-KUu2d9MbNKpCKJuZ7p8gwTL5B7NlUdh_dmSviPWrw

View this v2.0 sample token in jwt.ms.

Token lifetime

By default, an ID token is valid for one hour - after one hour, the client must acquire a new ID token.

You can adjust the lifetime of an ID token to control how often the client application expires the application session, and how often it requires the user to authenticate again either silently or interactively. For more information, read Configurable token lifetimes.

Validate tokens

To validate an ID token, your client can check whether the token has been tampered with. It can also validate the issuer to ensure that the correct issuer has sent back the token. Because ID tokens are always a JWT token, many libraries exist to validate these tokens - you should use one of these libraries rather than doing it yourself. Only confidential clients should validate ID tokens. For more information, see Secure applications and APIs by validating claims.

Public applications (code running entirely on a device or network you don't control such as a user's browser or their home network) don't benefit from validating the ID token. In this instance, a malicious user can intercept and edit the keys used for validation of the token.

The following JWT claims should be validated in the ID token after validating the signature on the token. Your token validation library may also validate the following claims:

  • Timestamps: the iat, nbf, and exp timestamps should all fall before or after the current time, as appropriate.
  • Audience: the aud claim should match the app ID for your application.
  • Nonce: the nonce claim in the payload must match the nonce parameter passed into the /authorize endpoint during the initial request.

Related content

ID tokens in the Microsoft identity platform - Microsoft identity platform (2024)
Top Articles
7 Types Of Investments For Beginners: Your Guide To Investing
Best High-Yield Savings Accounts For March 2024 - Up to 5.35% | Bankrate
Fort Morgan Hometown Takeover Map
craigslist: kenosha-racine jobs, apartments, for sale, services, community, and events
Craigslist Benton Harbor Michigan
Tv Guide Bay Area No Cable
Professor Qwertyson
Sissy Transformation Guide | Venus Sissy Training
San Diego Terminal 2 Parking Promo Code
Ap Chem Unit 8 Progress Check Mcq
More Apt To Complain Crossword
Directions To O'reilly's Near Me
The Cure Average Setlist
Images of CGC-graded Comic Books Now Available Using the CGC Certification Verification Tool
Lancasterfire Live Incidents
Recap: Noah Syndergaard earns his first L.A. win as Dodgers sweep Cardinals
Nhl Tankathon Mock Draft
Zack Fairhurst Snapchat
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Understanding Genetics
Uncovering The Mystery Behind Crazyjamjam Fanfix Leaked
Living Shard Calamity
Low Tide In Twilight Ch 52
Kohls Lufkin Tx
Milwaukee Nickname Crossword Clue
Egusd Lunch Menu
Smartfind Express Login Broward
Creed 3 Showtimes Near Island 16 Cinema De Lux
How Do Netspend Cards Work?
Chicago Pd Rotten Tomatoes
Capital Hall 6 Base Layout
Walter King Tut Johnson Sentenced
Toonily The Carry
How To Get Soul Reaper Knife In Critical Legends
Stanley Steemer Johnson City Tn
Search All of Craigslist: A Comprehensive Guide - First Republic Craigslist
Jason Brewer Leaving Fox 25
What Is Kik and Why Do Teenagers Love It?
Encompass.myisolved
Express Employment Sign In
Restored Republic June 6 2023
Mynord
Avatar: The Way Of Water Showtimes Near Jasper 8 Theatres
Jigidi Free Jigsaw
St Als Elm Clinic
Gummy Bear Hoco Proposal
The Significance Of The Haitian Revolution Was That It Weegy
Who We Are at Curt Landry Ministries
Ranking 134 college football teams after Week 1, from Georgia to Temple
E. 81 St. Deli Menu
Yoshidakins
Latest Posts
Article information

Author: Jerrold Considine

Last Updated:

Views: 5944

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.