Skip to content

Commit d52ed3b

Browse files
authored
Merge pull request #196728 from yoelhor/patch-266
XML format
2 parents 21b104c + ce24ea8 commit d52ed3b

File tree

1 file changed

+48
-42
lines changed

1 file changed

+48
-42
lines changed

articles/active-directory/develop/single-sign-on-saml-protocol.md

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.service: active-directory
1111
ms.subservice: develop
1212
ms.workload: identity
1313
ms.topic: conceptual
14-
ms.date: 08/24/2021
14+
ms.date: 02/05/2022
1515
ms.author: kenwith
1616
ms.custom: aaddev
1717
ms.reviewer: paulgarn
@@ -32,13 +32,13 @@ The protocol diagram below describes the single sign-on sequence. The cloud serv
3232

3333
To request a user authentication, cloud services send an `AuthnRequest` element to Azure AD. A sample SAML 2.0 `AuthnRequest` could look like the following example:
3434

35-
```
35+
```xml
3636
<samlp:AuthnRequest
37-
xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
38-
ID="id6c1c178c166d486687be4aaf5e482730"
39-
Version="2.0" IssueInstant="2013-03-18T03:28:54.1839884Z"
40-
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
41-
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://www.contoso.com</Issuer>
37+
xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
38+
ID="id6c1c178c166d486687be4aaf5e482730"
39+
Version="2.0" IssueInstant="2013-03-18T03:28:54.1839884Z"
40+
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
41+
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://www.contoso.com</Issuer>
4242
</samlp:AuthnRequest>
4343
```
4444

@@ -61,7 +61,7 @@ The `Issuer` element in an `AuthnRequest` must exactly match one of the **Servic
6161

6262
A SAML excerpt containing the `Issuer` element looks like the following sample:
6363

64-
```
64+
```xml
6565
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://www.contoso.com</Issuer>
6666
```
6767

@@ -71,7 +71,7 @@ This element requests a particular name ID format in the response and is optiona
7171

7272
A `NameIdPolicy` element looks like the following sample:
7373

74-
```
74+
```xml
7575
<NameIDPolicy Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"/>
7676
```
7777

@@ -87,23 +87,28 @@ If `SPNameQualifier` is specified, Azure AD will include the same `SPNameQualifi
8787
Azure AD ignores the `AllowCreate` attribute.
8888

8989
### RequestedAuthnContext
90+
9091
The `RequestedAuthnContext` element specifies the desired authentication methods. It is optional in `AuthnRequest` elements sent to Azure AD. Azure AD supports `AuthnContextClassRef` values such as `urn:oasis:names:tc:SAML:2.0:ac:classes:Password`.
9192

9293
### Scoping
94+
9395
The `Scoping` element, which includes a list of identity providers, is optional in `AuthnRequest` elements sent to Azure AD.
9496

9597
If provided, don't include the `ProxyCount` attribute, `IDPListOption` or `RequesterID` element, as they aren't supported.
9698

9799
### Signature
100+
98101
A `Signature` element in `AuthnRequest` elements is optional. Azure AD does not validate signed authentication requests if a signature is present. Requestor verification is provided for by only responding to registered Assertion Consumer Service URLs.
99102

100103
### Subject
104+
101105
Don't include a `Subject` element. Azure AD doesn't support specifying a subject for a request and will return an error if one is provided.
102106

103107
## Response
108+
104109
When a requested sign-on completes successfully, Azure AD posts a response to the cloud service. A response to a successful sign-on attempt looks like the following sample:
105110

106-
```
111+
```xml
107112
<samlp:Response ID="_a4958bfd-e107-4e67-b06d-0d85ade2e76a" Version="2.0" IssueInstant="2013-03-18T07:38:15.144Z" Destination="https://contoso.com/identity/inboundsso.aspx" InResponseTo="id758d0ef385634593a77bdf7e632984b6" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
108113
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion"> https://login.microsoftonline.com/82869000-6ad1-48f0-8171-272ed18796e9/</Issuer>
109114
<ds:Signature xmlns:ds="https://www.w3.org/2000/09/xmldsig#">
@@ -159,7 +164,7 @@ Azure AD sets the `Issuer` element to `https://sts.windows.net/<TenantIDGUID>/`
159164

160165
For example, a response with Issuer element could look like the following sample:
161166

162-
```
167+
```xml
163168
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion"> https://sts.windows.net/82869000-6ad1-48f0-8171-272ed18796e9/</Issuer>
164169
```
165170

@@ -171,17 +176,18 @@ The `Status` element conveys the success or failure of sign-on. It includes the
171176

172177
The following sample is a SAML response to an unsuccessful sign-on attempt.
173178

174-
```
179+
```xml
175180
<samlp:Response ID="_f0961a83-d071-4be5-a18c-9ae7b22987a4" Version="2.0" IssueInstant="2013-03-18T08:49:24.405Z" InResponseTo="iddce91f96e56747b5ace6d2e2aa9d4f8c" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
176181
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://sts.windows.net/82869000-6ad1-48f0-8171-272ed18796e9/</Issuer>
177182
<samlp:Status>
178183
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Requester">
179184
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported" />
180185
</samlp:StatusCode>
181186
<samlp:StatusMessage>AADSTS75006: An error occurred while processing a SAML2 Authentication request. AADSTS90011: The SAML authentication request property 'NameIdentifierPolicy/SPNameQualifier' is not supported.
182-
Trace ID: 66febed4-e737-49ff-ac23-464ba090d57c
183-
Timestamp: 2013-03-18 08:49:24Z</samlp:StatusMessage>
184-
</samlp:Status>
187+
Trace ID: 66febed4-e737-49ff-ac23-464ba090d57c
188+
Timestamp: 2013-03-18 08:49:24Z</samlp:StatusMessage>
189+
</samlp:Status>
190+
</samlp:Response>
185191
```
186192

187193
### Assertion
@@ -192,7 +198,7 @@ In addition to the `ID`, `IssueInstant` and `Version`, Azure AD sets the followi
192198

193199
This is set to `https://sts.windows.net/<TenantIDGUID>/`where \<TenantIDGUID> is the Tenant ID of the Azure AD tenant.
194200

195-
```
201+
```xml
196202
<Issuer>https://sts.windows.net/82869000-6ad1-48f0-8171-272ed18796e9/</Issuer>
197203
```
198204

@@ -202,10 +208,10 @@ Azure AD signs the assertion in response to a successful sign-on. The `Signature
202208

203209
To generate this digital signature, Azure AD uses the signing key in the `IDPSSODescriptor` element of its metadata document.
204210

205-
```
211+
```xml
206212
<ds:Signature xmlns:ds="https://www.w3.org/2000/09/xmldsig#">
207-
digital_signature_here
208-
</ds:Signature>
213+
digital_signature_here
214+
</ds:Signature>
209215
```
210216

211217
#### Subject
@@ -214,24 +220,24 @@ This specifies the principal that is the subject of the statements in the assert
214220

215221
The `Method` attribute of the `SubjectConfirmation` element is always set to `urn:oasis:names:tc:SAML:2.0:cm:bearer`.
216222

217-
```
223+
```xml
218224
<Subject>
219-
<NameID>Uz2Pqz1X7pxe4XLWxV9KJQ+n59d573SepSAkuYKSde8=</NameID>
220-
<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
221-
<SubjectConfirmationData InResponseTo="id758d0ef385634593a77bdf7e632984b6" NotOnOrAfter="2013-03-18T07:43:15.144Z" Recipient="https://contoso.com/identity/inboundsso.aspx" />
222-
</SubjectConfirmation>
225+
<NameID>Uz2Pqz1X7pxe4XLWxV9KJQ+n59d573SepSAkuYKSde8=</NameID>
226+
<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
227+
<SubjectConfirmationData InResponseTo="id758d0ef385634593a77bdf7e632984b6" NotOnOrAfter="2013-03-18T07:43:15.144Z" Recipient="https://contoso.com/identity/inboundsso.aspx" />
228+
</SubjectConfirmation>
223229
</Subject>
224230
```
225231

226232
#### Conditions
227233

228234
This element specifies conditions that define the acceptable use of SAML assertions.
229235

230-
```
236+
```xml
231237
<Conditions NotBefore="2013-03-18T07:38:15.128Z" NotOnOrAfter="2013-03-18T08:48:15.128Z">
232-
<AudienceRestriction>
233-
<Audience>https://www.contoso.com</Audience>
234-
</AudienceRestriction>
238+
<AudienceRestriction>
239+
<Audience>https://www.contoso.com</Audience>
240+
</AudienceRestriction>
235241
</Conditions>
236242
```
237243

@@ -244,9 +250,9 @@ The `NotBefore` and `NotOnOrAfter` attributes specify the interval during which
244250

245251
This contains a URI that identifies an intended audience. Azure AD sets the value of this element to the value of `Issuer` element of the `AuthnRequest` that initiated the sign-on. To evaluate the `Audience` value, use the value of the `App ID URI` that was specified during application registration.
246252

247-
```
253+
```xml
248254
<AudienceRestriction>
249-
<Audience>https://www.contoso.com</Audience>
255+
<Audience>https://www.contoso.com</Audience>
250256
</AudienceRestriction>
251257
```
252258

@@ -256,15 +262,15 @@ Like the `Issuer` value, the `Audience` value must exactly match one of the serv
256262

257263
This contains claims about the subject or user. The following excerpt contains a sample `AttributeStatement` element. The ellipsis indicates that the element can include multiple attributes and attribute values.
258264

259-
```
265+
```xml
260266
<AttributeStatement>
261-
<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name">
262-
<AttributeValue>[email protected]</AttributeValue>
263-
</Attribute>
264-
<Attribute Name="http://schemas.microsoft.com/identity/claims/objectidentifier">
265-
<AttributeValue>3F2504E0-4F89-11D3-9A0C-0305E82C3301</AttributeValue>
266-
</Attribute>
267-
...
267+
<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name">
268+
<AttributeValue>[email protected]</AttributeValue>
269+
</Attribute>
270+
<Attribute Name="http://schemas.microsoft.com/identity/claims/objectidentifier">
271+
<AttributeValue>3F2504E0-4F89-11D3-9A0C-0305E82C3301</AttributeValue>
272+
</Attribute>
273+
...
268274
</AttributeStatement>
269275
```
270276

@@ -278,10 +284,10 @@ This element asserts that the assertion subject was authenticated by a particula
278284
* The `AuthnInstant` attribute specifies the time at which the user authenticated with Azure AD.
279285
* The `AuthnContext` element specifies the authentication context used to authenticate the user.
280286

281-
```
287+
```xml
282288
<AuthnStatement AuthnInstant="2013-03-18T07:33:56.000Z" SessionIndex="_bf9c623d-cc20-407a-9a59-c2d0aee84d12">
283-
<AuthnContext>
284-
<AuthnContextClassRef> urn:oasis:names:tc:SAML:2.0:ac:classes:Password</AuthnContextClassRef>
285-
</AuthnContext>
289+
<AuthnContext>
290+
<AuthnContextClassRef> urn:oasis:names:tc:SAML:2.0:ac:classes:Password</AuthnContextClassRef>
291+
</AuthnContext>
286292
</AuthnStatement>
287293
```

0 commit comments

Comments
 (0)