Skip to content

Commit 97297a4

Browse files
committed
Update access-token to fix organization and words:
See also orignal for Will: #113030
1 parent ada3abf commit 97297a4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

articles/active-directory/develop/access-tokens.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: active-directory
88
ms.subservice: develop
99
ms.workload: identity
1010
ms.topic: conceptual
11-
ms.date: 05/26/2023
11+
ms.date: 8/1/2023
1212
ms.author: davidmu
1313
ms.custom: aaddev, curation-claims
1414
---
@@ -161,11 +161,15 @@ Azure AD also supports multi-tenant applications. These applications support:
161161
- Accounts in any organizational directory (any Azure AD directory): `https://login.microsoftonline.com/organizations`
162162
- Accounts in any organizational directory (any Azure AD directory) and personal Microsoft accounts (e.g. Skype, XBox): `https://login.microsoftonline.com/common`
163163

164-
For these applications Azure AD exposes tenant-independent versions of the OIDC document at [https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration](https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration) and [https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration](https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration) respectively. These endpoints return an issuer value, which is a template parametrized by the `tenantid`: `https://login.microsoftonline.com/{tenantid}/v2.0`. Applications may use these tenant-independent endpoints to validate tokens from every tenant with the following modifications: instead of expecting the issuer claim in the token to exactly match the issuer value from metadata, the application should replace the `{tenantid}` value in the issuer metadata with the tenant ID that is the target of the current request, and then check the exact match (`tid` claim of the token).
164+
For these applications Azure AD exposes tenant-independent versions of the OIDC document at [https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration](https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration) and [https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration](https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration) respectively. These endpoints return an issuer value, which is a template parametrized by the `tenantid`: `https://login.microsoftonline.com/{tenantid}/v2.0`. Applications may use these tenant-independent endpoints to validate tokens from every tenant with the following stipulations:
165+
- Validate the signing key issuer (below)
166+
- Instead of expecting the issuer claim in the token to exactly match the issuer value from metadata, the application should replace the `{tenantid}` value in the issuer metadata with the tenant ID that is the target of the current request, and then check the exact match (`tid` claim of the token).
167+
- Validate the `tid` claim is a GUID and the `iss` claim is of the form `https://login.microsoftonline.com/{tid}/v2.0` where `{tid}` is the exact `tid` claim. This ties the tenant back to the issuer and back to the scope of the signing key creating a chain of trust.
168+
- Use `tid` claim when they locate data associated with the subject of the claim. In other words, the `tid` claim must be part of the key used to access the user's data.
165169

166170
### Validate the signing key issuer
167171

168-
In addition to the issuer of the token, applications using the v2.0 tenant-independant metadata need to validate the signing key issuer.
172+
Applications using the v2.0 tenant-independant metadata need to validate the signing key issuer.
169173

170174
#### Keys document and signing key issuer
171175

@@ -194,15 +198,13 @@ tenant-independent "common" key endpoint [https://login.microsoftonline.com/comm
194198

195199
The application should use the `issuer` property of the keys document, associated with the key used to sign the token, in order to restrict the scope of keys:
196200
- Keys that have an issuer value with a GUID like `https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0` should only be used when the `iss` claim in the token matches the value exactly.
197-
- Keys that have a templated issuer value like `https://login.microsoftonline.com/{tenantid}/v2.0` need to ensure that:
198-
- the `tid` claim is a GUID and the `iss` claim is of the form `https://login.microsoftonline.com/{tid}/v2.0` where `{tid}` is the exact `tid` claim. This ties the tenant back to the issuer. back to the scope of the signing key creating a chain of trust.
199-
- Multi-tenant applications must use `tid` claim when they locate data associated with the subject of the claim. In other words, the `tid` claim must be part of the key used to access the user's data.
201+
- Keys that have a templated issuer value like `https://login.microsoftonline.com/{tenantid}/v2.0` should only be used when the `iss` claim in the token matches this value after substituting the `tid` claim in the token for the `{tenantid}` placeholder.
200202

201203
Using tenant-independent metadata is more efficient for applications that accept tokens from many tenants.
204+
202205
> [!NOTE]
203206
> With Azure AD tenant-independent metadata, claims should be interpreted within the tenant, just as under standard OpenID Connect, claims are interpreted within the issuer. That is, `{"sub":"ABC123","iss":"https://login.microsoftonline.com/{example-tenant-id}/v2.0","tid":"{example-tenant-id}"}` and `{"sub":"ABC123","iss":"https://login.microsoftonline.com/{another-tenand-id}/v2.0","tid":"{another-tenant-id}"}` describe different users, even though the `sub` is the same, because claims like `sub` are interpreted within the context of the issuer/tenant.
204207
205-
206208
#### Recap
207209

208210
Here is some pseudo code that recapitulates how to validate issuer and signing key issuer:
@@ -266,4 +268,3 @@ A *non-password-based* login is one where the user didn't type in a password to
266268
## Next steps
267269

268270
- Learn more about the [security tokens used in Azure AD](security-tokens.md).
269-

0 commit comments

Comments
 (0)