Skip to content

Commit 95859b6

Browse files
authored
docs: add new cli parameters to docs (#567)
1 parent 4dfbeef commit 95859b6

File tree

4 files changed

+12
-90
lines changed

4 files changed

+12
-90
lines changed

docs/Configuration.md

Lines changed: 6 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -10,92 +10,7 @@ Take a look at the [FAQ](./FAQ) section, for common questions, issues and soluti
1010

1111
openvpn-auth-oauth2 supports configuration via a YAML file. The file can be passed via the `--config` flag.
1212

13-
<details>
14-
<summary>Example config.yaml</summary>
15-
16-
```yaml
17-
debug:
18-
pprof: false
19-
listen: ":9001"
20-
http:
21-
assets-path: "" # Example: "/etc/openvpn-auth-oauth2/assets/"
22-
baseurl: "http://localhost:9000/"
23-
cert: ""
24-
check:
25-
ipaddr: false
26-
enable-proxy-headers: true
27-
key: ""
28-
listen: ":9000"
29-
# secret: ""
30-
# template: "" # Path to a HTML file which is displayed at the end of the screen
31-
tls: false
32-
log:
33-
format: console
34-
level: INFO
35-
vpn-client-ip: true
36-
oauth2:
37-
authorize-params: "a=c"
38-
client:
39-
id: "test"
40-
secret: "test"
41-
endpoint:
42-
# discovery: "https://idp/.well-known/openid-configuration"
43-
# auth: "https://idp/oauth/auth"
44-
# token: "https://idp/oauth/token"
45-
issuer: "https://idp"
46-
# provider: "generic"
47-
# scopes:
48-
# - "openid"
49-
# - "profile"
50-
validate:
51-
acr:
52-
# - "phr"
53-
# - "phrh"
54-
common-name: ""
55-
common-name-case-sensitive: false
56-
# groups:
57-
# - "test"
58-
# - "test2"
59-
# roles:
60-
# - "test"
61-
# - "test2"
62-
ipaddr: false
63-
issuer: true
64-
nonce: true
65-
pkce: true
66-
auth-style: "AuthStyleInParams"
67-
refresh:
68-
enabled: false
69-
expires: 8h0m0s
70-
# secret: ""
71-
use-session-id: false
72-
validate-user: true
73-
openvpn:
74-
addr: "unix:///run/openvpn/server.sock"
75-
auth-token-user: false
76-
auth-pending-timeout: 2m
77-
bypass:
78-
# common-names:
79-
# - "test"
80-
# - "test2"
81-
override-username: false
82-
ccd:
83-
enabled: false
84-
token-claim: ""
85-
path: "/etc/openvpn-auth-oauth2/client-config/"
86-
common-name:
87-
environment-variable-name: common_name
88-
mode: plain
89-
# password: ""
90-
pass-through:
91-
address: "unix:///run/openvpn/pass-through.sock"
92-
enabled: false
93-
# password: ""
94-
# socket-group: ""
95-
# socket-mode: 660
96-
reauthentication: true
97-
```
98-
</details>
13+
See the [example configuration file](https://github.com/jkroepke/openvpn-auth-oauth2/blob/main/packaging/etc/openvpn-auth-oauth2/config.yaml).
9914

10015
## Supported configuration properties
10116

@@ -155,6 +70,8 @@ Usage of openvpn-auth-oauth2:
15570
The flag is used to set a custom OAuth2 discovery URL. This URL retrieves the provider's configuration details. (env: CONFIG_OAUTH2_ENDPOINT_DISCOVERY)
15671
--oauth2.endpoint.token value
15772
The flag is used to specify a custom OAuth2 token endpoint. (env: CONFIG_OAUTH2_ENDPOINT_TOKEN)
73+
--oauth2.groups-claim string
74+
Defines the claim name in the ID Token which contains the user groups. (env: CONFIG_OAUTH2_GROUPS__CLAIM) (default "groups")
15875
--oauth2.issuer value
15976
oauth2 issuer (env: CONFIG_OAUTH2_ISSUER)
16077
--oauth2.nonce
@@ -175,10 +92,12 @@ Usage of openvpn-auth-oauth2:
17592
If true, openvpn-auth-oauth2 will validate the user against the OIDC provider on each refresh. Usefully, if API limits are exceeded or OIDC provider can't deliver an refresh token. (env: CONFIG_OAUTH2_REFRESH_VALIDATE__USER) (default true)
17693
--oauth2.scopes value
17794
oauth2 token scopes. Defaults depends on oauth2.provider. Comma separated list. Example: openid,profile,email (env: CONFIG_OAUTH2_SCOPES)
95+
--oauth2.user-info
96+
If true, openvpn-auth-oauth2 uses the OIDC UserInfo endpoint to fetch additional information about the user (e.g. groups). (env: CONFIG_OAUTH2_USER__INFO)
17897
--oauth2.validate.acr value
17998
oauth2 required acr values. Comma separated list. Example: phr,phrh (env: CONFIG_OAUTH2_VALIDATE_ACR)
18099
--oauth2.validate.common-name string
181-
validate common_name from OpenVPN with IDToken claim. For example: preferred_username or sub (env: CONFIG_OAUTH2_VALIDATE_COMMON__NAME)
100+
validate common_name from OpenVPN with ID Token claim. For example: preferred_username or sub (env: CONFIG_OAUTH2_VALIDATE_COMMON__NAME)
182101
--oauth2.validate.common-name-case-sensitive
183102
If true, openvpn-auth-oauth2 will validate the common case in sensitive mode (env: CONFIG_OAUTH2_VALIDATE_COMMON__NAME__CASE__SENSITIVE)
184103
--oauth2.validate.groups value

docs/Providers.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ If you are using Self-Managed GitLab, your instance must have enabled HTTPS.
335335
```ini
336336
CONFIG_OAUTH2_ISSUER=https://gitlab.com/
337337
CONFIG_OAUTH2_SCOPES=openid profile email
338-
CONFIG_OAUTH2_USERINFO=true
338+
CONFIG_OAUTH2_USER__INFO=true
339339
CONFIG_OAUTH2_CLIENT_ID=<client_id>
340340
CONFIG_OAUTH2_CLIENT_SECRET=<client_secret>
341341
```
@@ -353,6 +353,7 @@ oauth2:
353353
client:
354354
id: "<client_id>"
355355
secret: "<client_secret>"
356+
user-info: true
356357
```
357358
</td></tr></tbody>
358359
</table>

internal/config/flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func (c *Config) flagSetOAuth2(flagSet *flag.FlagSet) {
300300
&c.OAuth2.GroupsClaim,
301301
"oauth2.groups-claim",
302302
lookupEnvOrDefault("oauth2.groups-claim", c.OAuth2.GroupsClaim),
303-
"Defines the claim name in the IDToken which contains the user groups.",
303+
"Defines the claim name in the ID Token which contains the user groups.",
304304
)
305305
flagSet.BoolVar(
306306
&c.OAuth2.Nonce,
@@ -386,7 +386,7 @@ func (c *Config) flagSetOAuth2(flagSet *flag.FlagSet) {
386386
&c.OAuth2.Validate.CommonName,
387387
"oauth2.validate.common-name",
388388
lookupEnvOrDefault("oauth2.validate.common-name", c.OAuth2.Validate.CommonName),
389-
"validate common_name from OpenVPN with IDToken claim. For example: preferred_username or sub",
389+
"validate common_name from OpenVPN with ID Token claim. For example: preferred_username or sub",
390390
)
391391
flagSet.BoolVar(
392392
&c.OAuth2.Validate.CommonNameCaseSensitive,

packaging/etc/openvpn-auth-oauth2/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@
2828
# discovery: "https://idp/.well-known/openid-configuration"
2929
# auth: "https://idp/oauth/auth"
3030
# token: "https://idp/oauth/token"
31+
# group-claim: "groups"
3132
# issuer: "https://idp"
3233
# provider: "generic"
3334
# scopes:
3435
# - "openid"
3536
# - "profile"
37+
# user-info: false
3638
# validate:
3739
# acr: []
3840
# # - "phr"

0 commit comments

Comments
 (0)