Skip to content

Commit a89428d

Browse files
authored
Merge pull request #232027 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to main to sync with https://github.com/MicrosoftDocs/azure-docs (branch main)
2 parents a96ad86 + afd3c09 commit a89428d

11 files changed

+132
-112
lines changed

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

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -242,45 +242,34 @@ If the application has custom signing keys as a result of using the [claims-mapp
242242

243243
### Claims based authorization
244244

245-
The business logic of the application dictates claims based authorization. Some common authorization methods are listed below.
245+
The business logic of an application determines how authorization should be handled. The general approach to authorization based on token claims, and which claims should be used, is described below.
246246

247-
#### Validate the token
247+
After a token is validated with the correct `aud` claim, the token tenant, subject, actor must be authorized.
248248

249-
Use the `aud` claim to ensure that the user intended to call the application. If the identifier of the resource isn't in the `aud` claim, reject it.
249+
#### Tenant
250250

251-
#### Validate user permission
251+
First, always check that the `tid` in a token matches the tenant ID used to store data with the application. When information is stored for an application in the context of a tenant, it should only be accessed again later in the same tenant. Never allow data in one tenant to be accessed from another tenant.
252252

253-
Use the `roles` and `wids` claims to validate that the user has authorization to call the API. For example, an administrator may have permission to write to the API, but not a normal user. Check that the `tid` inside the token matches the tenant ID used to store the data in the API.
253+
#### Subject
254254

255-
When a user stores data in the API from one tenant, they must sign into that tenant again to access that data. Never allow data in one tenant to be accessed from another tenant.
255+
Next, to determine if the token subject, such as the user (or app itself in the case of an app-only token), is authorized, either check for specific `sub` or `oid` claims, or check that the subject belongs to an appropriate role or group with the `roles`, `groups`, `wids` claims.
256256

257-
Use the `amr` claim to verify the user has performed MFA. The enforcement of MFA is done using [Conditional Access](../conditional-access/overview.md). If `roles` or `groups` claims are requested in the access token, verify that the user is in the group allowed to do this action.
257+
For example, use the immutable claim values `tid` and `oid` as a combined key for application data and determining whether a user should be granted access.
258258

259-
For tokens retrieved using the implicit flow, query the [Microsoft Graph](https://developer.microsoft.com/graph/) for this data, as it's often too large to fit in the token.
259+
The `roles`, `groups` or `wids` claims can also be used to determine if the subject has authorization to perform an operation. For example, an administrator may have permission to write to an API, but not a normal user, or the user may be in a group allowed to do some action.
260260

261-
Don't use `email` or `upn` claim values to determine whether the user in an access token should have access to data. Mutable claim values like these can change over time, making them insecure and unreliable for authorization.
261+
> [!WARNING]
262+
> Never use `email` or `upn` claim values to store or determine whether the user in an access token should have access to data. Mutable claim values like these can change over time, making them insecure and unreliable for authorization.
262263
263-
Use immutable claim values `tid` and `sub` or `oid` as a combined key for uniquely identifying the API's data and determining whether a user should be granted access to that data.
264+
#### Actor
264265

265-
- Good: `tid` + `sub`
266-
- Better: `tid` + `oid` - the `oid` is consistent across applications, so an ecosystem of applications can audit user access to data.
266+
Lastly, when an app is acting for a user, this client app (the actor), must also be authorized. Use the `scp` claim (scope) to validate that the app has permission to perform an operation.
267267

268-
Don't use mutable, human-readable identifiers like `email` or `upn` for uniquely identifying data.
268+
Scopes are defined by the application, and the absence of `scp` claim means full actor permissions.
269269

270-
#### Validate application sign-in
271-
272-
* Use the `scp` claim to validate that the user has granted the calling app permission to call your API.
273-
* Ensure the calling client is allowed to call your API using the `appid` claim (for v1.0 tokens) or the `azp` claim (for v2.0 tokens).
274-
* You only need to validate these claims (`appid`, `azp`) if you want to restrict your web API to be called only by pre-determined applications (e.g., line-of-business applications or web APIs called by well-known frontends). APIs intended to allow access from any calling application do not need to validate these claims.
275-
276-
## User and application tokens
277-
278-
An application may receive tokens for a user or directly from an application through the client credentials flow. These app-only tokens indicate that this call is coming from an application and doesn't have a user backing it. These tokens are handled largely the same:
279-
280-
- Use `roles` to see permissions that have been granted to the subject of the token.
281-
- Use `oid` or `sub` to validate that the calling service principal is the expected one.
270+
> [!NOTE]
271+
> An application may handle app-only tokens (requests from applications without users, such as daemon apps) and want to authorize a specific application across multiple tenants, rather than individual service principal IDs. In that case, check for an app-only token using the `idtyp` optional claim and use the `appid` claim (for v1.0 tokens) or the `azp` claim (for v2.0 tokens) along with `tid` to determine authorization based on tenant and application ID.
282272
283-
If the application needs to distinguish between app-only access tokens and access tokens for users, use the `idtyp` [optional claim](active-directory-optional-claims.md). To detect app-only access tokens, add the `idtyp` claim to the `accessToken` field, and check for the value `app`. ID tokens and access tokens for users won't have the `idtyp` claim included.
284273

285274
## Token revocation
286275

articles/active-directory/develop/active-directory-schema-extensions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ The identifier for a directory extension attribute is of the form *extension_xxx
2727
## Registering and using directory extensions
2828
Directory extension attributes can be registered and populated in one of two ways:
2929

30-
- By configuring AD Connect to create them and to sync data into them from on-premises AD. See [Azure AD Connect Sync Directory Extensions](../hybrid/how-to-connect-sync-feature-directory-extensions.md).
30+
- By configuring Azure AD Connect to create them and to sync data into them from on-premises AD. See [Azure AD Connect Sync Directory Extensions](../hybrid/how-to-connect-sync-feature-directory-extensions.md).
3131
- By using Microsoft Graph to register, set the values of, and read from [directory extensions](/graph/extensibility-overview#directory-azure-ad-extensions). [PowerShell cmdlets](/powershell/azure/active-directory/using-extension-attributes-sample) are also available.
3232

33-
### Emitting claims with data from directory extension attributes created with AD Connect
34-
Directory extension attributes created and synced using AD Connect are always associated with the application ID used by AD Connect. They can be used as a source for claims both by configuring them as claims in the **Enterprise Applications** configuration in the Portal UI for SAML applications registered using the Gallery or the non-Gallery application configuration experience under **Enterprise Applications**, and via a claims-mapping policy for applications registered via the Application registration experience. Once a directory extension attribute created via AD Connect is in the directory, it will show in the SAML SSO claims configuration UI.
33+
### Emitting claims with data from directory extension attributes created with Azure AD Connect
34+
Directory extension attributes created and synced using Azure AD Connect are always associated with the application ID used by Azure AD Connect. These attributes can be used as a source for claims both by configuring them as claims in the **Enterprise Applications** configuration in the Portal UI for SAML applications registered using the Gallery or the non-Gallery application configuration experience under **Enterprise Applications**, and via a claims-mapping policy for applications registered via the Application registration experience. Once a directory extension attribute created via AD Connect is in the directory, it will show in the SAML SSO claims configuration UI.
3535

3636
### Emitting claims with data from directory extension attributes created for an application using Graph or PowerShell
3737
If a directory extension attribute is registered for an application using Microsoft Graph or PowerShell (via an applications initial setup or provisioning step for instance), the same application can be configured in Azure Active Directory to receive data in that attribute from a user object in a claim when the user signs in. The application can be configured to receive data in directory extensions that are registered on that same application using [optional claims](active-directory-optional-claims.md#configuring-directory-extension-optional-claims). These can be set in the application manifest. This enables a multi-tenant application to register directory extension attributes for its own use. When the application is provisioned into a tenant the associated directory extensions become available to be set on users in that tenant, and to be consumed. Once it's configured in the tenant and consent granted, it can be used to store and retrieve data via graph and to map to claims in tokens the Microsoft identity platform emits to applications.

articles/active-directory/identity-protection/howto-identity-protection-simulate-risk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Completing the following procedure requires you to use a user account that has:
6363

6464
**To simulate a sign-in from an unfamiliar location, perform the following steps**:
6565

66-
1. When signing in with your test account, fail the multifactor authentication (MFA) challenge by not passing the MFA challenge.
67-
2. Using your new VPN, navigate to [https://myapps.microsoft.com](https://myapps.microsoft.com) and enter the credentials of your test account.
66+
1. Using your new VPN, navigate to [https://myapps.microsoft.com](https://myapps.microsoft.com) and enter the credentials of your test account.
67+
2. When signing in with your test account, fail the multifactor authentication (MFA) challenge by not passing the MFA challenge.
6868

6969
The sign-in shows up on the Identity Protection dashboard within 10 - 15 minutes.
7070

articles/azure-maps/tutorial-create-store-locator.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
title: 'Tutorial: Use Microsoft Azure Maps to create store locator web applications'
33
titleSuffix: Microsoft Azure Maps
44
description: Tutorial on how to use Microsoft Azure Maps to create store locator web applications.
5-
author: eriklindeman
6-
ms.author: eriklind
5+
author: sinnypan
6+
ms.author: sipa
77
ms.date: 01/03/2022
88
ms.topic: tutorial
99
ms.service: azure-maps
@@ -42,12 +42,12 @@ In this tutorial, you'll learn how to:
4242

4343
In this tutorial, you'll create a store locator for a fictional company named *Contoso Coffee*. Also, this tutorial includes some tips to help you learn about extending the store locator with other optional functionality.
4444

45-
To see a live sample of what you will create in this tutorial, see [Simple Store Locator] on the **Azure Maps Code Samples** site.
45+
To see a live sample of what you're creating in this tutorial, see [Simple Store Locator] on the **Azure Maps Code Samples** site.
4646

47-
To more easily follow and engage this tutorial, you'll need to download the following resources:
47+
To more easily follow and engage this tutorial, download the following resources:
4848

49-
* Full source code for the [Simple Store Locator](https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator) on GitHub.
50-
* [Store location data](https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator/data) that you'll import into the store locator dataset.
49+
* [Simple Store Locator] source code.
50+
* [Store location data] used to import into the store locator dataset.
5151
* The [Map images].
5252

5353
## Store locator features
@@ -213,7 +213,7 @@ To create the HTML:
213213
</main>
214214
```
215215

216-
After you finish, *index.html* should look like [Simple Store Locator.html].
216+
After you finish, *index.html* should look like _[Simple Store Locator.html]_ in the tutorial sample code.
217217

218218
## Define the CSS styles
219219

@@ -1015,7 +1015,7 @@ In this tutorial, you learned how to create a basic store locator by using Azure
10151015

10161016
## Additional information
10171017

1018-
* For the completed code used in this tutorial, see the [Simple Store Locator](https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator) tutorial on GitHub.
1018+
* For the completed code, see the [Simple Store Locator tutorial on GitHub].
10191019
* To view this sample live, see [Simple Store Locator] on the **Azure Maps Code Samples** site.
10201020
* learn more about the coverage and capabilities of Azure Maps by using [Zoom levels and tile grid].
10211021
* You can also [Use data-driven style expressions] to apply to your business logic.
@@ -1032,21 +1032,24 @@ To see more code examples and an interactive coding experience:
10321032
[Manage authentication in Azure Maps]: how-to-manage-authentication.md
10331033
[Visual Studio Code]: https://code.visualstudio.com
10341034
[Simple Store Locator]: https://samples.azuremaps.com/?sample=simple-store-locator
1035+
[Simple Store Locator tutorial on GitHub]: https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator
1036+
[Simple Store Locator.html]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/master/Samples/Tutorials/Simple%20Store%20Locator/Simple%20Store%20Locator.html
1037+
10351038
[data]: https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator/data
10361039
[Search service]: /rest/api/maps/search
10371040
[Spherical Mercator projection]: glossary.md#spherical-mercator-projection
10381041
[EPSG:3857]: https://epsg.io/3857
10391042
[EPSG:4326]: https://epsg.io/4326
10401043
[ContosoCoffee.xlsx]: https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator/data
10411044
[Map images]: https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator/images
1042-
[Simple Store Locator.html]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/master/Samples/Tutorials/Simple%20Store%20Locator/Simple%20Store%20Locator.html
10431045
[event listener]: /javascript/api/azure-maps-control/atlas.map#events
1044-
[suggestions as you type]: (https://samples.azuremaps.com/?sample=search-autosuggest-and-jquery-ui
1045-
[support for multiple languages]: (https://samples.azuremaps.com/?sample=map-localization
1046-
[filter locations along a route]: (https://samples.azuremaps.com/?sample=filter-data-along-route
1047-
[set filters]: (https://samples.azuremaps.com/?sample=filter-symbols-by-property
1046+
[suggestions as you type]: https://samples.azuremaps.com/?sample=search-autosuggest-and-jquery-ui
1047+
[support for multiple languages]: https://samples.azuremaps.com/?sample=map-localization
1048+
[filter locations along a route]: https://samples.azuremaps.com/?sample=filter-data-along-route
1049+
[set filters]: https://samples.azuremaps.com/?sample=filter-symbols-by-property
10481050
[Azure App Service Web App]: ../app-service/quickstart-html.md
10491051
[SQL Server spatial data types overview]: /sql/relational-databases/spatial/spatial-data-types-overview?preserve-view=true&view=sql-server-2017
10501052
[Query spatial data for the nearest neighbor]: /sql/relational-databases/spatial/query-spatial-data-for-nearest-neighbor?preserve-view=true&view=sql-server-2017
10511053
[Zoom levels and tile grid]: zoom-levels-and-tile-grid.md
10521054
[Use data-driven style expressions]: data-driven-style-expressions-web-sdk.md
1055+
[Store location data]: https://github.com/Azure-Samples/AzureMapsCodeSamples/tree/master/Samples/Tutorials/Simple%20Store%20Locator/data

0 commit comments

Comments
 (0)