You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/develop/access-tokens.md
+15-26Lines changed: 15 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,45 +242,34 @@ If the application has custom signing keys as a result of using the [claims-mapp
242
242
243
243
### Claims based authorization
244
244
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.
246
246
247
-
#### Validate the token
247
+
After a token is validated with the correct `aud` claim, the token tenant, subject, actor must be authorized.
248
248
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
250
250
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.
252
252
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
254
254
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.
256
256
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.
258
258
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.
260
260
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.
262
263
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
264
265
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.
267
267
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.
269
269
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.
282
272
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.
Copy file name to clipboardExpand all lines: articles/active-directory/develop/active-directory-schema-extensions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,11 @@ The identifier for a directory extension attribute is of the form *extension_xxx
27
27
## Registering and using directory extensions
28
28
Directory extension attributes can be registered and populated in one of two ways:
29
29
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).
31
31
- 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.
32
32
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.
35
35
36
36
### Emitting claims with data from directory extension attributes created for an application using Graph or PowerShell
37
37
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.
Copy file name to clipboardExpand all lines: articles/azure-maps/tutorial-create-store-locator.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
title: 'Tutorial: Use Microsoft Azure Maps to create store locator web applications'
3
3
titleSuffix: Microsoft Azure Maps
4
4
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
7
7
ms.date: 01/03/2022
8
8
ms.topic: tutorial
9
9
ms.service: azure-maps
@@ -42,12 +42,12 @@ In this tutorial, you'll learn how to:
42
42
43
43
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.
44
44
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.
46
46
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:
48
48
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.
51
51
* The [Map images].
52
52
53
53
## Store locator features
@@ -213,7 +213,7 @@ To create the HTML:
213
213
</main>
214
214
```
215
215
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.
217
217
218
218
## Define the CSS styles
219
219
@@ -1015,7 +1015,7 @@ In this tutorial, you learned how to create a basic store locator by using Azure
1015
1015
1016
1016
## Additional information
1017
1017
1018
-
* For the completed code used inthis 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].
1019
1019
* To view this sample live, see [Simple Store Locator] on the **Azure Maps Code Samples** site.
1020
1020
* learn more about the coverage and capabilities of Azure Maps by using [Zoom levels and tile grid].
1021
1021
* 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:
1032
1032
[Manage authentication in Azure Maps]: how-to-manage-authentication.md
1033
1033
[Visual Studio Code]: https://code.visualstudio.com
1034
1034
[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
[Simple Store Locator.html]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/master/Samples/Tutorials/Simple%20Store%20Locator/Simple%20Store%20Locator.html
[Azure App Service Web App]: ../app-service/quickstart-html.md
1049
1051
[SQL Server spatial data types overview]:/sql/relational-databases/spatial/spatial-data-types-overview?preserve-view=true&view=sql-server-2017
1050
1052
[Query spatial data for the nearest neighbor]:/sql/relational-databases/spatial/query-spatial-data-for-nearest-neighbor?preserve-view=true&view=sql-server-2017
1051
1053
[Zoom levels and tile grid]: zoom-levels-and-tile-grid.md
0 commit comments