Skip to content

Commit 92d2ab2

Browse files
authored
Merge pull request #31530 from nschonni/fix--articles/active-directory/manage-apps/use-scim-to-provision-users-and-groups.md
fix: articles/active-directory/manage-apps/use-scim-to-provision-users-and-groups.md
2 parents b9e81a0 + 1997f85 commit 92d2ab2

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

articles/active-directory/manage-apps/use-scim-to-provision-users-and-groups.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ The easiest way to implement a SCIM endpoint that can accept provisioning reques
630630
1. In this folder, launch the FileProvisioning\Host\FileProvisioningService.csproj project in Visual Studio.
631631
1. Select **Tools** > **NuGet Package Manager** > **Package Manager Console**, and execute the following commands for the FileProvisioningService project to resolve the solution references:
632632

633-
```
633+
```powershell
634634
Update-Package -Reinstall
635635
```
636636

@@ -699,6 +699,7 @@ To develop your own web service that conforms to the SCIM specification, first f
699699
### Building a Custom SCIM Endpoint
700700
Developers using the CLI libraries can host their services within any executable CLI assembly, or within Internet Information Services. Here is sample code for hosting a service within an executable assembly, at the address http://localhost:9000:
701701

702+
```csharp
702703
private static void Main(string[] arguments)
703704
{
704705
// Microsoft.SystemForCrossDomainIdentityManagement.IMonitor,
@@ -767,6 +768,7 @@ Developers using the CLI libraries can host their services within any executable
767768
}
768769
}
769770
}
771+
```
770772

771773
This service must have an HTTP address and server authentication certificate of which the root certification authority is one of the following names:
772774

@@ -788,6 +790,7 @@ Here, the value provided for the certhash argument is the thumbprint of the cert
788790

789791
To host the service within Internet Information Services, a developer would build a CLI code library assembly with a class named Startup in the default namespace of the assembly. Here is a sample of such a class:
790792

793+
```csharp
791794
public class Startup
792795
{
793796
// Microsoft.SystemForCrossDomainIdentityManagement.IWebApplicationStarter,
@@ -815,6 +818,7 @@ To host the service within Internet Information Services, a developer would buil
815818
this.starter.ConfigureApplication(builder);
816819
}
817820
}
821+
```
818822

819823
### Handling endpoint authentication
820824
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 Azure Active Directory Graph web 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. If the token was issued for accessing the Azure Active Directory Graph web service, then the identifier of that service, 00000002-0000-0000-c000-000000000000, should be in the value of the token’s aud claim. Each of the applications that are registered in a single tenant may receive the same `iss` claim with SCIM requests.
@@ -823,8 +827,8 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
823827

824828
1. In a provider, implement the Microsoft.SystemForCrossDomainIdentityManagement.IProvider.StartupBehavior property by having it return a method to be called whenever the service is started:
825829

826-
```
827-
public override Action\<Owin.IAppBuilder, System.Web.Http.HttpConfiguration.HttpConfiguration\> StartupBehavior
830+
```csharp
831+
public override Action<Owin.IAppBuilder, System.Web.Http.HttpConfiguration.HttpConfiguration> StartupBehavior
828832
{
829833
get
830834
{
@@ -841,7 +845,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
841845

842846
2. Add the following code to that method to have any request to any of the service’s endpoints authenticated as bearing a token issued by Azure Active Directory for a specified tenant, for access to the Azure AD Graph web service:
843847

844-
```
848+
```csharp
845849
private void OnServiceStartup(
846850
Owin.IAppBuilder applicationBuilder IAppBuilder applicationBuilder,
847851
System.Web.Http.HttpConfiguration HttpConfiguration configuration)
@@ -879,12 +883,12 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
879883
>[!NOTE]
880884
> This is an example only. Not all users will have a mailNickname attribute, and the value a user has may not be unique in the directory. Also, the attribute used for matching (which in this case is externalId) is configurable in the [Azure AD attribute mappings](customize-application-attributes.md).
881885
882-
````
886+
```
883887
GET https://.../scim/Users?filter=externalId eq jyoung HTTP/1.1
884888
Authorization: Bearer ...
885-
````
889+
```
886890
If the service was built using the CLI libraries provided by Microsoft for implementing SCIM services, then the request is translated into a call to the Query method of the service’s provider. Here is the signature of that method:
887-
````
891+
```csharp
888892
// System.Threading.Tasks.Tasks is defined in mscorlib.dll.
889893
// Microsoft.SystemForCrossDomainIdentityManagement.Resource is defined in
890894
// Microsoft.SystemForCrossDomainIdentityManagement.Schemas.
@@ -894,9 +898,9 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
894898
System.Threading.Tasks.Task<Microsoft.SystemForCrossDomainIdentityManagement.Resource[]> Query(
895899
Microsoft.SystemForCrossDomainIdentityManagement.IQueryParameters parameters,
896900
string correlationIdentifier);
897-
````
901+
```
898902
Here is the definition of the Microsoft.SystemForCrossDomainIdentityManagement.IQueryParameters interface:
899-
````
903+
```csharp
900904
public interface IQueryParameters:
901905
Microsoft.SystemForCrossDomainIdentityManagement.IRetrievalParameters
902906
{
@@ -913,6 +917,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
913917
string SchemaIdentifier
914918
{ get; }
915919
}
920+
```
916921

917922
```
918923
GET https://.../scim/Users?filter=externalId eq jyoung HTTP/1.1
@@ -921,7 +926,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
921926

922927
If the service was built using the Common Language Infrastructure libraries provided by Microsoft for implementing SCIM services, then the request is translated into a call to the Query method of the service’s provider. Here is the signature of that method:
923928

924-
```
929+
```csharp
925930
// System.Threading.Tasks.Tasks is defined in mscorlib.dll.
926931
// Microsoft.SystemForCrossDomainIdentityManagement.Resource is defined in
927932
// Microsoft.SystemForCrossDomainIdentityManagement.Schemas.
@@ -935,7 +940,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
935940

936941
Here is the definition of the Microsoft.SystemForCrossDomainIdentityManagement.IQueryParameters interface:
937942

938-
```
943+
```csharp
939944
public interface IQueryParameters:
940945
Microsoft.SystemForCrossDomainIdentityManagement.IRetrievalParameters
941946
{
@@ -980,7 +985,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
980985

981986
2. If the response to a query to the web service for a user with an externalId attribute value that matches the mailNickname attribute value of a user doesn't return any users, then Azure Active Directory requests that the service provision a user corresponding to the one in Azure Active Directory. Here is an example of such a request:
982987

983-
````
988+
```
984989
POST https://.../scim/Users HTTP/1.1
985990
Authorization: Bearer ...
986991
Content-type: application/scim+json
@@ -1009,26 +1014,26 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
10091014
"title":null,
10101015
"department":null,
10111016
"manager":null}
1012-
````
1017+
```
10131018
The CLI libraries provided by Microsoft for implementing SCIM services would translate that request into a call to the Create method of the service’s provider. The Create method has this signature:
1014-
````
1019+
```csharp
10151020
// System.Threading.Tasks.Tasks is defined in mscorlib.dll.
10161021
// Microsoft.SystemForCrossDomainIdentityManagement.Resource is defined in
10171022
// Microsoft.SystemForCrossDomainIdentityManagement.Schemas.
10181023
10191024
System.Threading.Tasks.Task<Microsoft.SystemForCrossDomainIdentityManagement.Resource> Create(
10201025
Microsoft.SystemForCrossDomainIdentityManagement.Resource resource,
10211026
string correlationIdentifier);
1022-
````
1027+
```
10231028
In a request to provision a user, the value of the resource argument is an instance of the Microsoft.SystemForCrossDomainIdentityManagement. Core2EnterpriseUser class, defined in the Microsoft.SystemForCrossDomainIdentityManagement.Schemas library. If the request to provision the user succeeds, then the implementation of the method is expected to return an instance of the Microsoft.SystemForCrossDomainIdentityManagement. Core2EnterpriseUser class, with the value of the Identifier property set to the unique identifier of the newly provisioned user.
10241029

10251030
3. To update a user known to exist in an identity store fronted by an SCIM, Azure Active Directory proceeds by requesting the current state of that user from the service with a request such as:
1026-
````
1031+
```
10271032
GET ~/scim/Users/54D382A4-2050-4C03-94D1-E769F1D15682 HTTP/1.1
10281033
Authorization: Bearer ...
1029-
````
1034+
```
10301035
In a service built using the CLI libraries provided by Microsoft for implementing SCIM services, the request is translated into a call to the Retrieve method of the service’s provider. Here is the signature of the Retrieve method:
1031-
````
1036+
```csharp
10321037
// System.Threading.Tasks.Tasks is defined in mscorlib.dll.
10331038
// Microsoft.SystemForCrossDomainIdentityManagement.Resource and
10341039
// Microsoft.SystemForCrossDomainIdentityManagement.IResourceRetrievalParameters
@@ -1054,7 +1059,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
10541059
string Microsoft.SystemForCrossDomainIdentityManagement.SchemaIdentifier
10551060
{ get; set; }
10561061
}
1057-
````
1062+
```
10581063
In the example of a request to retrieve the current state of a user, the values of the properties of the object provided as the value of the parameters argument are as follows:
10591064

10601065
* Identifier: "54D382A4-2050-4C03-94D1-E769F1D15682"
@@ -1077,7 +1082,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
10771082
Here, the value of the index x can be 0 and the value of the index y can be 1, or the value of x can be 1 and the value of y can be 0, depending on the order of the expressions of the filter query parameter.
10781083

10791084
5. Here is an example of a request from Azure Active Directory to an SCIM service to update a user:
1080-
````
1085+
```
10811086
PATCH ~/scim/Users/54D382A4-2050-4C03-94D1-E769F1D15682 HTTP/1.1
10821087
Authorization: Bearer ...
10831088
Content-type: application/scim+json
@@ -1095,9 +1100,9 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
10951100
{
10961101
"$ref":"http://.../scim/Users/2819c223-7f76-453a-919d-413861904646",
10971102
"value":"2819c223-7f76-453a-919d-413861904646"}]}]}
1098-
````
1103+
```
10991104
The Microsoft CLI libraries for implementing SCIM services would translate the request into a call to the Update method of the service’s provider. Here is the signature of the Update method:
1100-
````
1105+
```csharp
11011106
// System.Threading.Tasks.Tasks and
11021107
// System.Collections.Generic.IReadOnlyCollection<T>
11031108
// are defined in mscorlib.dll.
@@ -1131,7 +1136,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
11311136
<Microsoft.SystemForCrossDomainIdentityManagement.PatchOperation>
11321137
Operations
11331138
{ get;}
1134-
1139+
```
11351140

11361141
If the service was built using the Common Language Infrastructure libraries provided by Microsoft for implementing SCIM services, then the request is translated into a call to the Query method of the service’s provider. The value of the properties of the object provided as the value of the parameters argument are as follows:
11371142

@@ -1171,7 +1176,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
11711176

11721177
The Microsoft Common Language Infrastructure libraries for implementing SCIM services would translate the request into a call to the Update method of the service’s provider. Here is the signature of the Update method:
11731178

1174-
```
1179+
```csharp
11751180
// System.Threading.Tasks.Tasks and
11761181
// System.Collections.Generic.IReadOnlyCollection<T>
11771182
// are defined in mscorlib.dll.
@@ -1272,7 +1277,7 @@ Developers using the CLI libraries provided by Microsoft for building a SCIM ser
12721277

12731278
If the service was built using the Common Language Infrastructure libraries provided by Microsoft for implementing SCIM services, then the request is translated into a call to the Delete method of the service’s provider. That method has this signature:
12741279

1275-
```
1280+
```csharp
12761281
// System.Threading.Tasks.Tasks is defined in mscorlib.dll.
12771282
// Microsoft.SystemForCrossDomainIdentityManagement.IResourceIdentifier,
12781283
// is defined in Microsoft.SystemForCrossDomainIdentityManagement.Protocol.
@@ -1345,7 +1350,7 @@ Group resources are identified by the schema identifier, `urn:ietf:params:scim:s
13451350
| proxyAddresses |emails[type eq "other"].Value |
13461351

13471352
## Allow IP addresses used by the Azure AD provisioning service to make SCIM requests
1348-
Certain apps allow inbound traffic to their app. In order for the Azure AD provisioning service to function as expected, the IP addresses used must be allowed. For a list of IP addresses for each service tag/region, see the JSON file - [Azure IP Ranges and Service Tags – Public Cloud](https://www.microsoft.com/download/details.aspx?id=56519). You can download and program these IPs into your firewall as needed. The reserved IP ranges for for Azure AD provisioning can be found under "AzureActiveDirectoryDomainServices."
1353+
Certain apps allow inbound traffic to their app. In order for the Azure AD provisioning service to function as expected, the IP addresses used must be allowed. For a list of IP addresses for each service tag/region, see the JSON file - [Azure IP Ranges and Service Tags – Public Cloud](https://www.microsoft.com/download/details.aspx?id=56519). You can download and program these IPs into your firewall as needed. The reserved IP ranges for Azure AD provisioning can be found under "AzureActiveDirectoryDomainServices."
13491354

13501355

13511356
## Related articles

0 commit comments

Comments
 (0)