Skip to content

Commit 4631917

Browse files
authored
Merge pull request #104684 from msmimart/mm-scim
[App Prov] Incorporate recent revisions into use-scim-to-provision-users-and-groups
2 parents 5772739 + 9cffff6 commit 4631917

File tree

1 file changed

+100
-11
lines changed

1 file changed

+100
-11
lines changed

articles/active-directory/app-provisioning/use-scim-to-provision-users-and-groups.md

Lines changed: 100 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Build a SCIM endpoint for user provisioning to apps from Azure AD
3-
description: Learn to build a SCIM endpoint, integrate your SCIM API with Azure Active Directory, and start automating provisioning users and groups into your cloud applications.
2+
title: Develop a SCIM endpoint for user provisioning to apps from Azure AD
3+
description: System for Cross-domain Identity Management (SCIM) standardizes automatic user provisioning. Learn to develop a SCIM endpoint, integrate your SCIM API with Azure Active Directory, and start automating provisioning users and groups into your cloud applications.
44
services: active-directory
55
documentationcenter: ''
66
author: msmimart
@@ -12,7 +12,7 @@ ms.workload: identity
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
1414
ms.topic: conceptual
15-
ms.date: 11/15/2019
15+
ms.date: 02/18/2020
1616
ms.author: mimart
1717
ms.reviewer: arvinh
1818
ms.custom: aaddev;it-pro;seohack1
@@ -46,15 +46,53 @@ Automating provisioning to an application requires building and integrating a SC
4646

4747
## Step 1: Design your user and group schema
4848

49-
Every application requires different attributes to create a user or group. Start your integration by identifying the objects (users, groups) and attributes (name, manager, job title, etc.) that your application requires. You can then use the table below to understand how the attributes your application requires could map to an attribute in Azure AD and the SCIM RFC. Note that you can [customize](customize-application-attributes.md) how attributes are mapped between Azure AD and your SCIM endpoint.
49+
Every application requires different attributes to create a user or group. Start your integration by identifying the objects (users, groups) and attributes (name, manager, job title, etc.) that your application requires. The SCIM standard defines a schema for managing users and groups. The core user schema only requires three attributes: **id** (service provider defined identifier), **externalId** (client defined identifier), and **meta** (read-only metadata maintained by the service provider). All other attributes are optional. In addition to the core user schema, the SCIM standard defines an enterprise user extension and a model for extending the user schema to meet your application’s needs. If, for example, your application requires a user’s manager, you can use the enterprise user schema to collect the user’s manager and the core schema to collect the user’s email. To design your schema, follow the steps below:
50+
1. List the attributes your application requires. It can be helpful to break down your requirements into the attributes needed for authentication (e.g. loginName and email), attributes needed to manage the lifecycle of the user (e.g. status / active), and other attributes needed for your particular application to work (e.g. manager, tag).
51+
2. Check whether those attributes are already defined in the core user schema or enterprise user schema. If any attributes that you need and aren’t covered in the core or enterprise user schemas, you will need to define an extension to the user schema that covers the attributes you need. In the example below, we’ve added an extension to the user to allow provisioning a “tag” on a user. It is best to start with just the core and enterprise user schemas and expand out to additional custom schemas later.
52+
3. Map the SCIM attributes to the user attributes in Azure AD. If one of the attributes you have defined in your SCIM endpoint does not have a clear counterpart on the Azure AD user schema, there is a good chance the data isn’t stored on the user object at all on most tenants. Consider whether this attribute can be optional for creating a user. If the attribute is critical for your application to work, guide the tenant administrator to extend their schema or use an extension attribute as shown below for the “tags” property.
5053

51-
User resources are identified by the schema identifier, `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User`, which is included in this protocol specification: https://tools.ietf.org/html/rfc7643. The default mapping of the attributes of users in Azure AD to the attributes of user resources is provided in Table 1.
54+
### Table 1: Outline the attributes that you need
55+
| Step 1: Determine attributes your app requires| Step 2: Map app requirements to SCIM standard| Step 3: Map SCIM attributes to the Azure AD attributes|
56+
|--|--|--|
57+
|loginName|userName|userPrincipalName|
58+
|firstName|name.givenName|givenName|
59+
|lastName|name.lastName|lastName|
60+
|workMail|Emails[type eq “work”].value|Mail|
61+
|manager|manager|manager|
62+
|tag|urn:ietf:params:scim:schemas:extension:2.0:CustomExtension:tag|extensionAttribute1|
63+
|status|active|isSoftDeleted (computed value not stored on user)|
5264

53-
Group resources are identified by the schema identifier, `urn:ietf:params:scim:schemas:core:2.0:Group`. Table 2 shows the default mapping of the attributes of groups in Azure AD to the attributes of group resources.
65+
The schema defined above would be represented using the Json payload below. Note that in addition to the attributes required for the application, the JSON representation includes the required “id,” “externalId,” and “meta” attributes.
5466

55-
Note that you don't need to support both users and groups or all the attributes shown below. They are a reference for how attributes in Azure AD are often mapped to properties in the SCIM protocol.
56-
57-
### Table 1: Default user attribute mapping
67+
```json
68+
{
69+
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User",
70+
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
71+
"urn:ietf:params:scim:schemas:extension:CustomExtensionName:2.0:User"],
72+
"userName":"bjensen",
73+
"externalId":"bjensen",
74+
"name":{
75+
"familyName":"Jensen",
76+
"givenName":"Barbara"
77+
},
78+
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
79+
"Manager": "123456"
80+
},
81+
"urn:ietf:params:scim:schemas:extension:CustomExtensionName:2.0:CustomAttribute:User": {
82+
"tag": "701984",
83+
},
84+
"meta": {
85+
"resourceType": "User",
86+
"created": "2010-01-23T04:56:22Z",
87+
"lastModified": "2011-05-13T04:42:34Z",
88+
"version": "W\/\"3694e05e9dff591\"",
89+
"location":
90+
"https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646"
91+
}
92+
```
93+
94+
### Table 2: Default user attribute mapping
95+
You can then use the table below to understand how the attributes your application requires could map to an attribute in Azure AD and the SCIM RFC. You can [customize](customize-application-attributes.md) how attributes are mapped between Azure AD and your SCIM endpoint. Note that you don't need to support both users and groups or all the attributes shown below. They are a reference for how attributes in Azure AD are often mapped to properties in the SCIM protocol.
5896

5997
| Azure Active Directory user | "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" |
6098
| --- | --- |
@@ -78,7 +116,7 @@ Note that you don't need to support both users and groups or all the attributes
78116
| user-PrincipalName |userName |
79117

80118

81-
### Table 2: Default group attribute mapping
119+
### Table 3: Default group attribute mapping
82120

83121
| Azure Active Directory group | urn:ietf:params:scim:schemas:core:2.0:Group |
84122
| --- | --- |
@@ -89,6 +127,20 @@ Note that you don't need to support both users and groups or all the attributes
89127
| objectId |externalId |
90128
| proxyAddresses |emails[type eq "other"].Value |
91129

130+
There are several endpoints defined in the SCIM RFC. You can get started with the /User endpoint and then expand from there. The /Schemas endpoint is helpful when using custom attributes or if your schema changes frequently. It enables a client to retrieve the most up-to-date schema automatically. The /Bulk endpoint is especially helpful when supporting groups. The table below describes the various endpoints defined in the SCIM standard.
131+
The /Schemas endpoint is helpful when using custom attributes or if your schema changes frequently. It enables a client to retrieve the most up to date schema automatically. The /Bulk endpoint is especially helpful when supporting groups. The table below describes the various endpoints defined in the SCIM standard.
132+
133+
### Table 4: Determine the endpoints that you would like to develop
134+
|ENDPOINT|DESCRIPTION|
135+
|--|--|
136+
|/User|Perform CRUD operations on a user object.|
137+
|/Group|Perform CRUD operations on a group object.|
138+
|/ServiceProviderConfig|Provides details about the features of the SCIM standard that are supported, for example the resources that are supported and the authentication method.|
139+
|/ResourceTypes|Specifies metadata about each resource|
140+
|/Schemas|The set of attributes supported by each client and service provider can vary. While one service provider might include “name,” “title,” and “emails,” while another service provider uses “name,” “title,” and “phoneNumbers.” The schemas endpoint allows for discovery of the attributes supported.|
141+
|/Bulk|Bulk operations allow you to perform operations on a large collection of resource objects in a single operation (e.g. update memberships for a large group).|
142+
143+
92144
## Step 2: Understand the Azure AD SCIM implementation
93145
> [!IMPORTANT]
94146
> The behavior of the Azure AD SCIM implementation was last updated on December 18, 2018. For information on what changed, see [SCIM 2.0 protocol compliance of the Azure AD User Provisioning service](../manage-apps/application-provisioning-config-problem-scim-compatibility.md).
@@ -672,6 +724,34 @@ This section provides example SCIM requests emitted by the Azure AD SCIM client
672724

673725
*HTTP/1.1 204 No Content*
674726

727+
### Security requirements
728+
**TLS Protocol Versions**
729+
730+
The only acceptable TLS protocol versions are TLS 1.2 and TLS 1.3. No other versions of TLS are permitted. No version of SSL is permitted.
731+
- RSA keys must be at least 2,048 bits.
732+
- ECC keys must be at least 256 bits, generated using an approved elliptic curve
733+
734+
735+
**Key Lengths**
736+
737+
All services must use X.509 certificates generated using cryptographic keys of sufficient length, meaning:
738+
739+
**Cipher Suites**
740+
741+
All services must be configured to use the following cipher suites, in the exact order specified below. Note that if you only have an RSA certificate, installed the ECDSA cipher suites do not have any effect. </br>
742+
743+
TLS 1.2 Cipher Suites minimum bar:
744+
745+
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
746+
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
747+
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
748+
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
749+
- TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
750+
- TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
751+
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
752+
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
753+
754+
675755
## Step 3: Build a SCIM endpoint
676756

677757
By creating a SCIM web service that interfaces with Azure Active Directory, you can enable automatic user provisioning for virtually any application or identity store.
@@ -886,7 +966,7 @@ To host the service within Internet Information Services, a developer would buil
886966

887967
### Handling endpoint authentication
888968

889-
Requests from Azure Active Directory include an OAuth 2.0 bearer token. Any service receiving the request should authenticate the issuer as being Azure Active Directory for the expected Azure Active Directory tenant, for access to the Microsoft Graph API service. In the token, the issuer is identified by an iss claim, like "iss":"https://sts.windows.net/cbb1a5ac-f33b-45fa-9bf5-f37db0fed422/". In this example, the base address of the claim value, https://sts.windows.net, identifies Azure Active Directory as the issuer, while the relative address segment, cbb1a5ac-f33b-45fa-9bf5-f37db0fed422, is a unique identifier of the Azure Active Directory tenant for which the token was issued. The audience for the token will be the application template ID for the app in the gallery. The application template ID for all custom apps is 8adf8e6e-67b2-4cf2-a259-e3dc5476c621. The application template ID for each app in the gallery varies. Please contact [email protected] for questions on the application template ID for a gallery application. Each of the applications registered in a single tenant may receive the same `iss` claim with SCIM requests.
969+
Requests from Azure Active Directory include an OAuth 2.0 bearer token. Any service receiving the request should authenticate the issuer as being Azure Active Directory for the expected Azure Active Directory tenant, for access to the Microsoft Graph API service. In the token, the issuer is identified by an iss claim, like "iss":"https://sts.windows.net/cbb1a5ac-f33b-45fa-9bf5-f37db0fed422/". In this example, the base address of the claim value, https://sts.windows.net, identifies Azure Active Directory as the issuer, while the relative address segment, cbb1a5ac-f33b-45fa-9bf5-f37db0fed422, is a unique identifier of the Azure Active Directory tenant for which the token was issued. The audience for the token will be the application template ID for the app in the gallery. The application template ID for all custom apps is 8adf8e6e-67b2-4cf2-a259-e3dc5476c621. The application template ID for each app in the gallery varies. Please contact [email protected] for questions on the application template ID for a gallery application. Each of the applications registered in a single tenant may receive the same `iss` claim with SCIM requests.
890970

891971
Developers using the CLI libraries provided by Microsoft for building a SCIM service can authenticate requests from Azure Active Directory using the Microsoft.Owin.Security.ActiveDirectory package by following these steps:
892972

@@ -1371,12 +1451,21 @@ If you're building an application that will be used by more than one tenant, you
13711451
### Authorization for provisioning connectors in the application gallery
13721452
The SCIM spec does not define a SCIM-specific scheme for authentication and authorization. It relies on the use of existing industry standards. The Azure AD provisioning client supports two authorization methods for applications in the gallery.
13731453

1454+
|Authorization method|Pros|Cons|Support|
1455+
|--|--|--|--|
1456+
|Username and password (not recommended or supported by Azure AD)|Easy to implement|Insecure - [Your Pa$$word doesn't matter](https://techcommunity.microsoft.com/t5/azure-active-directory-identity/your-pa-word-doesn-t-matter/ba-p/731984)|Supported on a case-by-case basis for gallery apps. Not supported for non-gallery apps.|
1457+
|Long-lived bearer token (supported by Azure AD currently)|Long-lived tokens do not require a user to be present. They are easy for admins to use when setting up provisioning.|Long-lived tokens can be hard to share with an admin without using insecure methods such as email. |Supported for gallery and non-gallery apps. |
1458+
|OAuth authorization code grant (supported by Azure AD currently)|Access tokens are much shorter-lived than passwords, and have an automated refresh mechanism that long-lived bearer tokens do not have. A real user must be present during initial authorization, adding a level of accountability. |Requires a user to be present. If the user leaves the organization, the token is invalid and authorization will need to be completed again.|Supported for gallery apps. Support for non-gallery apps is underway.|
1459+
|OAuth client credentials grant (not supported, on our roadmap)|Access tokens are much shorter-lived than passwords, and have an automated refresh mechanism that long-lived bearer tokens do not have. Both the authorization code grant and the client credentials grant create the same type of access token, so moving between these methods is transparent to the API. Provisioning can be completely automated, and new tokens can be silently requested without user interaction. ||Not supported for gallery and non-gallery apps. Support is in our backlog.|
1460+
13741461
**OAuth authorization code grant flow:** The provisioning service supports the [authorization code grant](https://tools.ietf.org/html/rfc6749#page-24). After submitting your request for publishing your app in the gallery, our team will work with you to collect the following information:
13751462
* Authorization URL: A URL by the client to obtain authorization from the resource owner via user-agent redirection. The user is redirected to this URL to authorize access.
13761463
* Token exchange URL: A URL by the client to exchange an authorization grant for an access token, typically with client authentication.
13771464
* Client ID: The authorization server issues the registered client a client identifier, which is a unique string representing the registration information provided by the client. The client identifier is not a secret; it is exposed to the resource owner and **must not** be used alone for client authentication.
13781465
* Client secret: The client secret is a secret generated by the authorization server. It should be a unique value known only to the authorization server.
13791466

1467+
Note that OAuth v1 is not supported due to exposure of the client secret. OAuth v2 is supported.
1468+
13801469
Best practices (recommended but not required):
13811470
* Support multiple redirect URLs. Administrators can configure provisioning from both "portal.azure.com" and "aad.portal.azure.com". Supporting multiple redirect URLs will ensure that users can authorize access from either portal.
13821471
* Support multiple secrets to ensure smooth secret renewal, without downtime.

0 commit comments

Comments
 (0)