---
title: "GET /identity/oauth2/token"
method: GET
path: "/identity/oauth2/token"
tags: ["Get token"]
---

# GET /identity/oauth2/token

`GET /identity/oauth2/token`

Get a Token from Azure AD

## Query parameters

- `resource` string, required
- `api-version` string, required
- `client_id` string
- `object_id` string
- `msi_res_id` string
- `authority` string
- `bypass_cache` 'true'

## Headers

- `Metadata` 'true', required

## Response `200`

Successful operation

- IdentityTokenResponse — This is the response from the Identity_GetToken operation.
  - `access_token` string — This is the requested access token. The app can use this token to authenticate to the sink resource.
  - `expires_in` string — This is how long the access token is valid (in seconds).
  - `expires_on` string — This is the time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. This value is used to determine the lifetime of cached tokens.
  - `ext_expires_in` string — This indicates the extended lifetime of the token (in seconds).
  - `not_before` string — This is the time when the access token becomes effective. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time.
  - `resource` string — This is the app ID URI of the sink resource.
  - `token_type` string — This indicates the token type value.
  - `client_id` string — This is the client_id specified in the request, if any.
  - `object_id` string — This is the object_id specified in the request, if any.
  - `msi_res_id` string — This is the msi_res_id specified in the request, if any.

## Other responses

- `default` — Error response describing why the operation failed.

## Changes

- **2026-07-13** (2018-02-01) `e65fff975b3a` — 1 info
  - the endpoint scheme security `basic_auth` was added to the API
- **2026-07-13** (2018-02-01) `503e7225df0f` — 5 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `404`
  - added the non-success response with the status `405`
  - added the non-success response with the status `429`
  - …1 more
- **2026-07-13** (2018-02-01) `eb496c25f2af` — 5 info
  - removed the non-success response with the status `400`
  - removed the non-success response with the status `404`
  - removed the non-success response with the status `405`
  - removed the non-success response with the status `429`
  - …1 more

[Change history](https://skmtc.dev/azure/apis/imds-instancemetadataservice/changes/identity/oauth2/token/get.md)

---

[API](https://skmtc.dev/azure/apis/imds-instancemetadataservice.md) · [All operations](https://skmtc.dev/azure/apis/imds-instancemetadataservice/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/imds-instancemetadataservice/revisions/6e1cf4083a8b/schema)
