Skip to content

Commit 522114e

Browse files
authored
Merge pull request #189724 from yoelhor/patch-246
Issue #88158 fix
2 parents dcc5b4e + 8bf22b1 commit 522114e

File tree

1 file changed

+46
-11
lines changed

1 file changed

+46
-11
lines changed

articles/active-directory-b2c/session-behavior.md

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: CelesteDG
88
ms.service: active-directory
99
ms.workload: identity
1010
ms.topic: how-to
11-
ms.date: 11/30/2021
11+
ms.date: 02/25/2022
1212
ms.custom: project-no-code
1313
ms.author: kengaderdus
1414
ms.subservice: B2C
@@ -79,11 +79,12 @@ You can configure the Azure AD B2C session behavior, including:
7979
- **Application** - This setting allows you to maintain a user session exclusively for an application, independent of other applications. For example, you can use this setting if you want the user to sign in to Contoso Pharmacy regardless of whether the user is already signed into Contoso Groceries.
8080
- **Policy** - This setting allows you to maintain a user session exclusively for a user flow, independent of the applications using it. For example, if the user has already signed in and completed a multi-factor authentication (MFA) step, the user can be given access to higher-security parts of multiple applications, as long as the session tied to the user flow doesn't expire.
8181
- **Suppressed** - This setting forces the user to run through the entire user flow upon every execution of the policy.
82-
- **Keep me signed in (KMSI)** - Extends the session lifetime through the use of a persistent cookie. If this feature is enabled and the user selects it, the session remains active even after the user closes and reopens the browser. The session is revoked only when the user signs out. The KMSI feature only applies to sign-in with local accounts. The KMSI feature takes precedence over the session lifetime.
8382

8483
::: zone pivot="b2c-user-flow"
8584

86-
To configure the session behavior:
85+
### Configure the user flow
86+
87+
To configure the session behavior in your user flow, follow these steps:
8788

8889
1. Sign in to the [Azure portal](https://portal.azure.com).
8990
1. Make sure you're using the directory that contains your Azure AD B2C tenant. Select the **Directories + subscriptions** icon in the portal toolbar.
@@ -99,15 +100,49 @@ To configure the session behavior:
99100

100101
::: zone pivot="b2c-custom-policy"
101102

102-
To change your session behavior and SSO configurations, you add a **UserJourneyBehaviors** element inside of the [RelyingParty](relyingparty.md) element. The **UserJourneyBehaviors** element must immediately follow the **DefaultUserJourney**. Your **UserJourneyBehavors** element should look like this example:
103+
### Configure the custom policy
104+
105+
To configure the session behavior in your custom policy, follow these steps:
106+
107+
1. Open the relying party (RP) file, for example *SignUpOrSignin.xml*
108+
1. If it doesn't already exist, add the following `<UserJourneyBehaviors>` element to the `<RelyingParty>` element. It must be located immediately after `<DefaultUserJourney ReferenceId="UserJourney Id"/>`.
109+
110+
```xml
111+
<UserJourneyBehaviors>
112+
<SingleSignOn Scope="Application" />
113+
<SessionExpiryType>Absolute</SessionExpiryType>
114+
<SessionExpiryInSeconds>86400</SessionExpiryInSeconds>
115+
</UserJourneyBehaviors>
116+
```
117+
118+
After you add the user journey behavior elements, the `RelyingParty` element should look like the following example:
119+
120+
```xml
121+
<RelyingParty>
122+
<DefaultUserJourney ReferenceId="SignUpOrSignIn" />
123+
<UserJourneyBehaviors>
124+
<SingleSignOn Scope="Application" />
125+
<SessionExpiryType>Absolute</SessionExpiryType>
126+
<SessionExpiryInSeconds>86400</SessionExpiryInSeconds>
127+
</UserJourneyBehaviors>
128+
<TechnicalProfile Id="PolicyProfile">
129+
<DisplayName>PolicyProfile</DisplayName>
130+
<Protocol Name="OpenIdConnect" />
131+
<OutputClaims>
132+
<OutputClaim ClaimTypeReferenceId="displayName" />
133+
<OutputClaim ClaimTypeReferenceId="givenName" />
134+
...
135+
</OutputClaims>
136+
<SubjectNamingInfo ClaimType="sub" />
137+
</TechnicalProfile>
138+
</RelyingParty>
139+
```
140+
141+
142+
1. Change the value of the `Scope` attribute to one of the possible value: `Suppressed`, `Tenant`, `Application`, or `Policy`. For more information, check out the [RelyingParty](relyingparty.md) reference article.
143+
1. Set the `SessionExpiryType` element to `Rolling` or `Absolute`. For more information, check out the [RelyingParty](relyingparty.md) reference article.
144+
1. Set the `SessionExpiryInSeconds` element to a numeric value between 900 seconds (15 minutes) and 86,400 seconds(24 hours). For more information, check out the [RelyingParty](relyingparty.md) reference article.
103145

104-
```xml
105-
<UserJourneyBehaviors>
106-
<SingleSignOn Scope="Application" />
107-
<SessionExpiryType>Absolute</SessionExpiryType>
108-
<SessionExpiryInSeconds>86400</SessionExpiryInSeconds>
109-
</UserJourneyBehaviors>
110-
```
111146
::: zone-end
112147

113148
## Enable Keep me signed in (KMSI)

0 commit comments

Comments
 (0)