You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Client specific configuration.md
+160Lines changed: 160 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,3 +13,163 @@ The feature must be enabled with `--openvpn.client-config.enabled`.
13
13
14
14
openvpn-auth-oauth2 looks for a file
15
15
named after the token claim or common name with `.conf` suffix in the client config directory.
16
+
17
+
## Client Profile Selector
18
+
19
+
The user profile selector feature allows users to choose their client configuration profile through a web UI after OAuth2 authentication. This is useful when:
20
+
- Users need access to different VPN configurations (e.g., different network segments, access levels)
21
+
- Profile assignments are determined by OAuth2 token claims (e.g., roles, groups, departments)
22
+
- You want to provide a self-service experience for profile selection
When enabled, openvpn-auth-oauth2 will display a profile selection UI after successful OAuth2 authentication. Users can choose from available profiles before connecting to the VPN.
37
+
38
+
Profile options are populated from:
39
+
- Static values configured via `--openvpn.client-config.user-selector.static-values`
40
+
- Token claim values from `--openvpn.client-config.token-claim` (if configured)
41
+
42
+
**Note:** The profile selector only appears when there are 2 or more profiles available. If only one profile is available, it will be automatically selected without showing the UI.
A comma-separated list of static profile names that are always available in the profile selector UI. These profiles will be displayed as selectable options for all authenticated users, regardless of their token claims.
Copy file name to clipboardExpand all lines: docs/Configuration.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,8 @@ Usage of openvpn-auth-oauth2:
42
42
listen addr for client listener (env: CONFIG_HTTP_LISTEN) (default ":9000")
43
43
--http.secret value
44
44
Random generated secret for cookie encryption. Must be 16, 24 or 32 characters. If argument starts with file:// it reads the secret from a file. (env: CONFIG_HTTP_SECRET)
45
+
--http.short-url
46
+
Enable short URL. The URL which is used for initial authentication will be reduced to /?s=... instead of /oauth2/start?state=... (env: CONFIG_HTTP_SHORT__URL)
45
47
--http.template value
46
48
Path to a HTML file which is displayed at the end of the screen. See https://github.com/jkroepke/openvpn-auth-oauth2/wiki/Layout-Customization for more information. (env: CONFIG_HTTP_TEMPLATE)
47
49
--http.tls
@@ -76,12 +78,12 @@ Usage of openvpn-auth-oauth2:
76
78
oauth2 issuer (env: CONFIG_OAUTH2_ISSUER)
77
79
--oauth2.nonce
78
80
If true, a nonce will be defined on the auth URL which is expected inside the token. (env: CONFIG_OAUTH2_NONCE) (default true)
79
-
--oauth2.refresh-nonce value
80
-
Controls nonce behavior on refresh token requests. Options: auto (try with nonce, retry without on error), empty (always use empty nonce), equal (use same nonce as initial auth). (env: CONFIG_OAUTH2_REFRESH__NONCE) (default auto)
81
81
--oauth2.pkce
82
82
If true, Proof Key for Code Exchange (PKCE) RFC 7636 is used for token exchange. (env: CONFIG_OAUTH2_PKCE) (default true)
Controls nonce behavior on refresh token requests. Options: auto (try with nonce, retry without on error), empty (always use empty nonce), equal (use same nonce as initial auth). (env: CONFIG_OAUTH2_REFRESH__NONCE) (default auto)
85
87
--oauth2.refresh.enabled
86
88
If true, openvpn-auth-oauth2 stores refresh tokens and will use it do an non-interaction reauth. (env: CONFIG_OAUTH2_REFRESH_ENABLED)
87
89
--oauth2.refresh.expires duration
@@ -124,6 +126,10 @@ Usage of openvpn-auth-oauth2:
124
126
Path to the CCD directory. openvpn-auth-oauth2 will look for an file with an .conf suffix and returns the content back. (env: CONFIG_OPENVPN_CLIENT__CONFIG_PATH)
125
127
--openvpn.client-config.token-claim string
126
128
If non-empty, the value of the token claim is used to lookup the configuration file in the CCD directory. If empty, the common name is used. (env: CONFIG_OPENVPN_CLIENT__CONFIG_TOKEN__CLAIM)
129
+
--openvpn.client-config.user-selector.enabled
130
+
If true, openvpn-auth-oauth2 will display a profile selection UI after OAuth2 authentication, allowing users to choose their client configuration profile. Profile options are populated from openvpn.client-config.user-selector.static-values and openvpn.client-config.token-claim (if configured). After selection, the chosen profile name is used to lookup the configuration file in the CCD directory. (env: CONFIG_OPENVPN_CLIENT__CONFIG_USER__SELECTOR_ENABLED)
131
+
--openvpn.client-config.user-selector.static-values value
132
+
Comma-separated list of static profile names that are always available in the profile selector UI. These profiles will be displayed as selectable options for all users. (env: CONFIG_OPENVPN_CLIENT__CONFIG_USER__SELECTOR_STATIC__VALUES)
Name of the environment variable in the OpenVPN management interface which contains the common name. If username-as-common-name is enabled, this should be set to 'username' to use the username as common name. Other values like 'X509_0_emailAddress' are supported. See https://openvpn.net/community-resources/reference-manual-for-openvpn-2-6/#environmental-variables for more information. (env: CONFIG_OPENVPN_COMMON__NAME_ENVIRONMENT__VARIABLE__NAME) (default "common_name")
"If true, openvpn-auth-oauth2 will display a profile selection UI after OAuth2 authentication, allowing users to choose their client configuration profile. "+
175
+
"Profile options are populated from openvpn.client-config.user-selector.static-values and openvpn.client-config.token-claim (if configured). "+
176
+
"After selection, the chosen profile name is used to lookup the configuration file in the CCD directory.",
0 commit comments