Skip to content

Commit 2843fda

Browse files
committed
rework session management page
1 parent 4f5dc6f commit 2843fda

File tree

1 file changed

+57
-15
lines changed

1 file changed

+57
-15
lines changed

src/content/docs/cloudflare-one/identity/users/session-management.mdx

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,28 @@ import { GlossaryTooltip, Render } from "~/components";
99

1010
A user session determines how long a user can access an Access application without re-authenticating.
1111

12-
## Session duration
12+
## Session durations
1313

1414
When a user logs in to an application protected by Access, Access validates their identity against your Access policies and generates two signed JSON Web Tokens (JWTs):
1515

1616
| Token | Description | Expiration | Storage |
1717
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
1818
| Global session token | Stores the user's identity from the IdP and provides single sign-on (SSO) functionality for all Access applications. | [Global session duration](#set-global-session-duration) | Your Cloudflare <GlossaryTooltip term="team domain">team domain</GlossaryTooltip> |
19-
| [Application token](/cloudflare-one/identity/authorization-cookie/application-token/) | Allows the user to access a specific Access application. | [Policy session duration](#set-policy-session-duration) (if set), otherwise the [application session duration](#set-application-session-duration) | The hostname protected by the Access application |
20-
| | | | |
19+
| [Application token](/cloudflare-one/identity/authorization-cookie/application-token/) | Allows the user to access a specific Access application. | [Policy session duration](#set-policy-session-duration), which defaults to the [application session duration](#set-application-session-duration) | The hostname protected by the Access application |
2120

2221
The user can access the application for the entire duration of the application token's lifecycle. When the application token expires, Cloudflare will automatically issue a new application token if the global token is still valid (and the user's identity still passes your Access policies). If the global token has also expired, the user will be prompted to re-authenticate with the IdP.
2322

2423
The global token expiration is usually set to equal or exceed the application token expiration. Setting a longer global token provides a more secure way to allow for longer user sessions, since the global token cannot be used to directly access an application.
2524

25+
As an analogy, you can think of the global session like a festival where you buy a ticket to enter for the day. For certain rides or areas, the staff may periodically check your ticket to make sure you are authorized to enter. For example, the backstage area may allow ticket holders to go on a 30 min tour, after which you need to sign up for another tour. This is analogous to the app session. Now imagine a special policy exists where VIP ticket holders can go backstage for as long as they want. The VIPs have a policy session duration which overrides the default 30 min value.
26+
2627
<Render file="access/one-time-pin-warning" />
2728

28-
### Set global session duration
29+
### Global session duration
30+
31+
The global session duration determines how often Cloudflare Access prompts the user to log in to their identity provider. You can set a global session duration between 15 minutes and 1 month.
2932

30-
You can set a global session duration between 15 minutes and 1 month.
33+
To set the global session duration:
3134

3235
1. In [Zero Trust](https://one.dash.cloudflare.com), go to **Settings** > **Authentication**.
3336
2. Under **Global session timeout**, select **Edit**,
@@ -36,16 +39,33 @@ You can set a global session duration between 15 minutes and 1 month.
3639

3740
The user will be required to re-authenticate with the IdP after this period of time.
3841

39-
### Set application session duration
42+
### Policy session duration
43+
44+
The policy session duration determines how long the user can access a self-hosted Access application. When the user's session expires, Access rechecks their stored user identity against the application's Access policies.
45+
46+
By default, the policy session duration is equal to the [application session duration](#set-application-session-duration). To configure more granular permissions for specific users, you can change the policy session duration to a value ranging from immediate timeout to one month. For example, you may wish to set the application session duration to 7 days for engineers, but set a policy session duration to 24 hours for contractors.
47+
48+
To set the policy session duration:
49+
50+
1. In [Zero Trust](https://one.dash.cloudflare.com), go to **Access** > **Policies**.
51+
2. Choose a policy and select **Configure**.
52+
3. Select a **Session Duration** from the dropdown menu.
53+
4. Save the policy.
54+
55+
Users who match this policy will be issued an application token with this expiration time.
56+
57+
### Application session duration
4058

41-
You can set an application session duration for self-hosted and private Access applications. Available session durations range from immediate timeout to 1 month. The default is 24 hours.
59+
The application session duration is the default [policy session duration](#policy-session-duration) for all policies in an Access application. Available session durations range from immediate timeout to 1 month.
60+
61+
To set the application session duration:
4262

4363
1. In [Zero Trust](https://one.dash.cloudflare.com), go to **Access** > **Applications**.
4464
2. Choose an application and select **Configure**.
4565
3. Select a **Session Duration** from the dropdown menu.
4666
4. Save the application.
4767

48-
The application token will expire after this period of time (unless you have set a [policy session duration](#set-policy-session-duration)).
68+
Users who match a policy configured with a _Same as application session timeout_ duration will be issued an application token with this expiration time.
4969

5070
#### SaaS applications
5171

@@ -55,16 +75,38 @@ The application token will expire after this period of time (unless you have set
5575

5676
<Render file="access/self-hosted-app/ssh-sessions" />
5777

58-
### Set policy session duration
78+
### WARP session duration
5979

60-
You can set a policy session duration ranging from immediate timeout to one month. The policy session duration takes precedence over the application session duration.
80+
When [WARP authentication identity](/cloudflare-one/connections/connect-devices/warp/configure-warp/warp-sessions/#configure-warp-sessions-in-access) is enabled for an Access application, the WARP session duration overrides the application and policy session durations. If the global session expires but the user already has a valid WARP session, the user will not need to reauthenticate with the IdP until the WARP session expires.
6181

62-
1. In [Zero Trust](https://one.dash.cloudflare.com), go to **Access** > **Policies**.
63-
2. Choose a policy and select **Configure**.
64-
3. Select a **Session Duration** from the dropdown menu.
65-
4. Save the policy.
82+
### Order of enforcement
6683

67-
Users who match this policy will be issued an application token with this expiration time.
84+
The following flowchart illustrates how Access enforces user sessions for a self-hosted application.
85+
86+
```mermaid
87+
flowchart TB
88+
%% Accessibility
89+
accTitle: Access session durations
90+
accDescr: Flowchart describing the order of enforcement for Access sessions
91+
92+
%% In with user traffic
93+
start["User goes to Access application"]
94+
start--"WARP authentication enabled" -->warpsession[WARP session expired?]
95+
start-- "WARP authentication disabled" --> policysession[Policy session expired?]
96+
97+
warpsession--"Yes"-->idp[Prompt to log in to IdP]
98+
warpsession--"No"-->accessgranted[Access granted]
99+
100+
policysession--"Yes"-->globalsession[Global session expired?]
101+
policysession--"No"-->accessgranted
102+
103+
globalsession--"Yes"-->idp
104+
globalsession--"No"-->refreshtoken[Check identity against Access policies]
105+
refreshtoken-->accessgranted
106+
idp-->refreshtoken
107+
108+
109+
```
68110

69111
## Revoke user sessions
70112

0 commit comments

Comments
 (0)