@@ -14,100 +14,101 @@ To generate a strong cookie secret use `python -c 'import os,base64; print base6
1414
1515### Config File
1616
17−An example [oauth2_proxy.cfg](contrib/oauth2_proxy.cfg.example) config file is in the contrib directory. It can be used by specifying `-config=/etc/oauth2_proxy.cfg`
17+An example [oauth2_proxy.cfg]({{ site.gitweb }}/contrib/oauth2_proxy.cfg.example) config file is in the contrib directory. It can be used by specifying `-config=/etc/oauth2_proxy.cfg`
1818
1919### Command Line Options
2020
21−```
22−Usage of oauth2_proxy:
23− -acr-values string: optional, used by login.gov (default "http://idmanagement.gov/ns/assurance/loa/1")
24− -approval-prompt string: OAuth approval_prompt (default "force")
25− -auth-logging: Log authentication attempts (default true)
26− -auth-logging-format string: Template for authentication log lines (see "Logging Configuration" paragraph below)
27− -authenticated-emails-file string: authenticate against emails via file (one per line)
28− -azure-tenant string: go to a tenant-specific or common (tenant-independent) endpoint. (default "common")
29− -basic-auth-password string: the password to set when passing the HTTP Basic Auth header
30− -client-id string: the OAuth Client ID: ie: "123456.apps.googleusercontent.com"
31− -client-secret string: the OAuth Client Secret
32− -config string: path to config file
33− -cookie-domain string: an optional cookie domain to force cookies to (ie: .yourcompany.com)
34− -cookie-expire duration: expire timeframe for cookie (default 168h0m0s)
35− -cookie-httponly: set HttpOnly cookie flag (default true)
36− -cookie-name string: the name of the cookie that the oauth_proxy creates (default "_oauth2_proxy")
37− -cookie-path string: an optional cookie path to force cookies to (ie: /poc/)* (default "/")
38− -cookie-refresh duration: refresh the cookie after this duration; 0 to disable
39− -cookie-secret string: the seed string for secure cookies (optionally base64 encoded)
40− -cookie-secure: set secure (HTTPS) cookie flag (default true)
41− -custom-templates-dir string: path to custom html templates
42− -display-htpasswd-form: display username / password login form if an htpasswd file is provided (default true)
43− -email-domain value: authenticate emails with the specified domain (may be given multiple times). Use * to authenticate any email
44− -extra-jwt-issuers: if -skip-jwt-bearer-tokens is set, a list of extra JWT issuer=audience pairs (where the issuer URL has a .well-known/openid-configuration or a .well-known/jwks.json)
45− -exclude-logging-paths: comma separated list of paths to exclude from logging, eg: "/ping,/path2" (default "" = no paths excluded)
46− -flush-interval: period between flushing response buffers when streaming responses (default "1s")
47− -banner string: custom banner string. Use "-" to disable default banner.
48− -footer string: custom footer string. Use "-" to disable default footer.
49− -gcp-healthchecks: will enable /liveness_check, /readiness_check, and / (with the proper user-agent) endpoints that will make it work well with GCP App Engine and GKE Ingresses (default false)
50− -github-org string: restrict logins to members of this organisation
51− -github-team string: restrict logins to members of any of these teams (slug), separated by a comma
52− -google-admin-email string: the google admin to impersonate for api calls
53− -google-group value: restrict logins to members of this google group (may be given multiple times).
54− -google-service-account-json string: the path to the service account json credentials
55− -htpasswd-file string: additionally authenticate against a htpasswd file. Entries must be created with "htpasswd -s" for SHA encryption
56− -http-address string: [http://]<addr>:<port> or unix://<path> to listen on for HTTP clients (default "127.0.0.1:4180")
57− -https-address string: <addr>:<port> to listen on for HTTPS clients (default ":443")
58− -logging-compress: Should rotated log files be compressed using gzip (default false)
59− -logging-filename string: File to log requests to, empty for stdout (default to stdout)
60− -logging-local-time: If the time in log files and backup filenames are local or UTC time (default true)
61− -logging-max-age int: Maximum number of days to retain old log files (default 7)
62− -logging-max-backups int: Maximum number of old log files to retain; 0 to disable (default 0)
63− -logging-max-size int: Maximum size in megabytes of the log file before rotation (default 100)
64− -jwt-key string: private key in PEM format used to sign JWT, so that you can say something like -jwt-key="${OAUTH2_PROXY_JWT_KEY}": required by login.gov
65− -jwt-key-file string: path to the private key file in PEM format used to sign the JWT so that you can say something like -jwt-key-file=/etc/ssl/private/jwt_signing_key.pem: required by login.gov
66− -login-url string: Authentication endpoint
67− -insecure-oidc-allow-unverified-email: don't fail if an email address in an id_token is not verified
68− -oidc-issuer-url: the OpenID Connect issuer URL. ie: "https://accounts.google.com"
69− -oidc-jwks-url string: OIDC JWKS URI for token verification; required if OIDC discovery is disabled
70− -pass-access-token: pass OAuth access_token to upstream via X-Forwarded-Access-Token header
71− -pass-authorization-header: pass OIDC IDToken to upstream via Authorization Bearer header
72− -pass-basic-auth: pass HTTP Basic Auth, X-Forwarded-User and X-Forwarded-Email information to upstream (default true)
73− -pass-host-header: pass the request Host Header to upstream (default true)
74− -pass-user-headers: pass X-Forwarded-User and X-Forwarded-Email information to upstream (default true)
75− -profile-url string: Profile access endpoint
76− -provider string: OAuth provider (default "google")
77− -ping-path string: the ping endpoint that can be used for basic health checks (default "/ping")
78− -proxy-prefix string: the url root path that this proxy should be nested under (e.g. /<oauth2>/sign_in) (default "/oauth2")
79− -proxy-websockets: enables WebSocket proxying (default true)
80− -pubjwk-url string: JWK pubkey access endpoint: required by login.gov
81− -redeem-url string: Token redemption endpoint
82− -redirect-url string: the OAuth Redirect URL. ie: "https://internalapp.yourcompany.com/oauth2/callback"
83− -redis-connection-url string: URL of redis server for redis session storage (eg: redis://HOST[:PORT])
84− -redis-sentinel-master-name string: Redis sentinel master name. Used in conjuction with --redis-use-sentinel
85− -redis-sentinel-connection-urls: List of Redis sentinel conneciton URLs (eg redis://HOST[:PORT]). Used in conjuction with --redis-use-sentinel
86− -redis-use-sentinel: Connect to redis via sentinels. Must set --redis-sentinel-master-name and --redis-sentinel-connection-urls to use this feature (default: false)
87− -request-logging: Log requests to stdout (default true)
88− -request-logging-format: Template for request log lines (see "Logging Configuration" paragraph below)
89− -resource string: The resource that is protected (Azure AD only)
90− -scope string: OAuth scope specification
91− -session-store-type: Session data storage backend (default: cookie)
92− -set-xauthrequest: set X-Auth-Request-User and X-Auth-Request-Email response headers (useful in Nginx auth_request mode)
93− -set-authorization-header: set Authorization Bearer response header (useful in Nginx auth_request mode)
94− -signature-key string: GAP-Signature request signature key (algorithm:secretkey)
95− -silence-ping-logging bool: disable logging of requests to ping endpoint (default false)
96− -skip-auth-preflight: will skip authentication for OPTIONS requests
97− -skip-auth-regex value: bypass authentication for requests path's that match (may be given multiple times)
98− -skip-jwt-bearer-tokens: will skip requests that have verified JWT bearer tokens
99− -skip-oidc-discovery: bypass OIDC endpoint discovery. login-url, redeem-url and oidc-jwks-url must be configured in this case
100− -skip-provider-button: will skip sign-in-page to directly reach the next step: oauth/start
101− -ssl-insecure-skip-verify: skip validation of certificates presented when using HTTPS
102− -standard-logging: Log standard runtime information (default true)
103− -standard-logging-format string: Template for standard log lines (see "Logging Configuration" paragraph below)
104− -tls-cert-file string: path to certificate file
105− -tls-key-file string: path to private key file
106− -upstream value: the http url(s) of the upstream endpoint or file:// paths for static files. Routing is based on the path
107− -validate-url string: Access token validation endpoint
108− -version: print version string
109− -whitelist-domain: allowed domains for redirection after authentication. Prefix domain with a . to allow subdomains (eg .example.com)
110−```
21+| Option | Type | Description | Default |
22+| ------ | ---- | ----------- | ------- |
23+| `-acr-values` | string | optional, used by login.gov | `"http://idmanagement.gov/ns/assurance/loa/1"` |
24+| `-approval-prompt` | string | OAuth approval_prompt | `"force"` |
25+| `-auth-logging` | bool | Log authentication attempts | true |
26+| `-auth-logging-format` | string | Template for authentication log lines | see [Logging Configuration](#logging-configuration) |
27+| `-authenticated-emails-file` | string | authenticate against emails via file (one per line) | |
28+| `-azure-tenant string` | string | go to a tenant-specific or common (tenant-independent) endpoint. | `"common"` |
29+| `-basic-auth-password` | string | the password to set when passing the HTTP Basic Auth header | |
30+| `-client-id` | string | the OAuth Client ID: ie: `"123456.apps.googleusercontent.com"` | |
31+| `-client-secret` | string | the OAuth Client Secret | |
32+| `-config` | string | path to config file | |
33+| `-cookie-domain` | string | an optional cookie domain to force cookies to (ie: `.yourcompany.com`) | |
34+| `-cookie-expire` | duration | expire timeframe for cookie | 168h0m0s |
35+| `-cookie-httponly` | bool | set HttpOnly cookie flag | true |
36+| `-cookie-name` | string | the name of the cookie that the oauth_proxy creates | `"_oauth2_proxy"` |
37+| `-cookie-path` | string | an optional cookie path to force cookies to (ie: `/poc/`) | `"/"` |
38+| `-cookie-refresh` | duration | refresh the cookie after this duration; `0` to disable | |
39+| `-cookie-secret` | string | the seed string for secure cookies (optionally base64 encoded) | |
40+| `-cookie-secure` | bool | set secure (HTTPS) cookie flag | true |
41+| `-custom-templates-dir` | string | path to custom html templates | |
42+| `-display-htpasswd-form` | bool | display username / password login form if an htpasswd file is provided | true |
43+| `-email-domain` | string | authenticate emails with the specified domain (may be given multiple times). Use `*` to authenticate any email | |
44+| `-extra-jwt-issuers` | string | if `-skip-jwt-bearer-tokens` is set, a list of extra JWT `issuer=audience` pairs (where the issuer URL has a `.well-known/openid-configuration` or a `.well-known/jwks.json`) | |
45+| `-exclude-logging-paths` | string | comma separated list of paths to exclude from logging, eg: `"/ping,/path2"` |`""` (no paths excluded) |
46+| `-flush-interval` | duration | period between flushing response buffers when streaming responses | `"1s"` |
47+| `-banner` | string | custom banner string. Use `"-"` to disable default banner. | |
48+| `-footer` | string | custom footer string. Use `"-"` to disable default footer. | |
49+| `-gcp-healthchecks` | bool | will enable `/liveness_check`, `/readiness_check`, and `/` (with the proper user-agent) endpoints that will make it work well with GCP App Engine and GKE Ingresses | false |
50+| `-github-org` | string | restrict logins to members of this organisation | |
51+| `-github-team` | string | restrict logins to members of any of these teams (slug), separated by a comma | |
52+| `-gitlab-group` | string | restrict logins to members of any of these groups (slug), separated by a comma | |
53+| `-google-admin-email` | string | the google admin to impersonate for api calls | |
54+| `-google-group` | string | restrict logins to members of this google group (may be given multiple times). | |
55+| `-google-service-account-json` | string | the path to the service account json credentials | |
56+| `-htpasswd-file` | string | additionally authenticate against a htpasswd file. Entries must be created with `htpasswd -s` for SHA encryption | |
57+| `-http-address` | string | `[http://]<addr>:<port>` or `unix://<path>` to listen on for HTTP clients | `"127.0.0.1:4180"` |
58+| `-https-address` | string | `<addr>:<port>` to listen on for HTTPS clients | `":443"` |
59+| `-logging-compress` | bool | Should rotated log files be compressed using gzip | false |
60+| `-logging-filename` | string | File to log requests to, empty for `stdout` | `""` (stdout) |
61+| `-logging-local-time` | bool | Use local time in log files and backup filenames instead of UTC | true (local time) |
62+| `-logging-max-age` | int | Maximum number of days to retain old log files | 7 |
63+| `-logging-max-backups` | int | Maximum number of old log files to retain; 0 to disable | 0 |
64+| `-logging-max-size` | int | Maximum size in megabytes of the log file before rotation | 100 |
65+| `-jwt-key` | string | private key in PEM format used to sign JWT, so that you can say something like `-jwt-key="${OAUTH2_PROXY_JWT_KEY}"`: required by login.gov | |
66+| `-jwt-key-file` | string | path to the private key file in PEM format used to sign the JWT so that you can say something like `-jwt-key-file=/etc/ssl/private/jwt_signing_key.pem`: required by login.gov | |
67+| `-login-url` | string | Authentication endpoint | |
68+| `-insecure-oidc-allow-unverified-email` | bool | don't fail if an email address in an id_token is not verified | false |
69+| `-oidc-issuer-url` | string | the OpenID Connect issuer URL. ie: `"https://accounts.google.com"` | |
70+| `-oidc-jwks-url` | string | OIDC JWKS URI for token verification; required if OIDC discovery is disabled | |
71+| `-pass-access-token` | bool | pass OAuth access_token to upstream via X-Forwarded-Access-Token header | false |
72+| `-pass-authorization-header` | bool | pass OIDC IDToken to upstream via Authorization Bearer header | false |
73+| `-pass-basic-auth` | bool | pass HTTP Basic Auth, X-Forwarded-User and X-Forwarded-Email information to upstream | true |
74+| `-pass-host-header` | bool | pass the request Host Header to upstream | true |
75+| `-pass-user-headers` | bool | pass X-Forwarded-User and X-Forwarded-Email information to upstream | true |
76+| `-profile-url` | string | Profile access endpoint | |
77+| `-provider` | string | OAuth provider | google |
78+| `-ping-path` | string | the ping endpoint that can be used for basic health checks | `"/ping"` |
79+| `-proxy-prefix` | string | the url root path that this proxy should be nested under (e.g. /`<oauth2>/sign_in`) | `"/oauth2"` |
80+| `-proxy-websockets` | bool | enables WebSocket proxying | true |
81+| `-pubjwk-url` | string | JWK pubkey access endpoint: required by login.gov | |
82+| `-redeem-url` | string | Token redemption endpoint | |
83+| `-redirect-url` | string | the OAuth Redirect URL. ie: `"https://internalapp.yourcompany.com/oauth2/callback"` | |
84+| `-redis-connection-url` | string | URL of redis server for redis session storage (eg: `redis://HOST[:PORT]`) | |
85+| `-redis-sentinel-master-name` | string | Redis sentinel master name. Used in conjunction with `--redis-use-sentinel` | |
86+| `-redis-sentinel-connection-urls` | string \| list | List of Redis sentinel connection URLs (eg `redis://HOST[:PORT]`). Used in conjunction with `--redis-use-sentinel` | |
87+| `-redis-use-sentinel` | bool | Connect to redis via sentinels. Must set `--redis-sentinel-master-name` and `--redis-sentinel-connection-urls` to use this feature | false |
88+| `-request-logging` | bool | Log requests | true |
89+| `-request-logging-format` | string | Template for request log lines | see [Logging Configuration](#logging-configuration) |
90+| `-resource` | string | The resource that is protected (Azure AD only) | |
91+| `-scope` | string | OAuth scope specification | |
92+| `-session-store-type` | string | Session data storage backend | cookie |
93+| `-set-xauthrequest` | bool | set X-Auth-Request-User and X-Auth-Request-Email response headers (useful in Nginx auth_request mode) | false |
94+| `-set-authorization-header` | bool | set Authorization Bearer response header (useful in Nginx auth_request mode) | false |
95+| `-signature-key` | string | GAP-Signature request signature key (algorithm:secretkey) | |
96+| `-silence-ping-logging` | bool | disable logging of requests to ping endpoint | false |
97+| `-skip-auth-preflight` | bool | will skip authentication for OPTIONS requests | false |
98+| `-skip-auth-regex` | string | bypass authentication for requests paths that match (may be given multiple times) | |
99+| `-skip-jwt-bearer-tokens` | bool | will skip requests that have verified JWT bearer tokens | false |
100+| `-skip-oidc-discovery` | bool | bypass OIDC endpoint discovery. `-login-url`, `-redeem-url` and `-oidc-jwks-url` must be configured in this case | false |
101+| `-skip-provider-button` | bool | will skip sign-in-page to directly reach the next step: oauth/start | false |
102+| `-ssl-insecure-skip-verify` | bool | skip validation of certificates presented when using HTTPS providers | false |
103+| `-ssl-upstream-insecure-skip-verify` | bool | skip validation of certificates presented when using HTTPS upstreams | false |
104+| `-standard-logging` | bool | Log standard runtime information | true |
105+| `-standard-logging-format` | string | Template for standard log lines | see [Logging Configuration](#logging-configuration) |
106+| `-tls-cert-file` | string | path to certificate file | |
107+| `-tls-key-file` | string | path to private key file | |
108+| `-upstream` | string \| list | the http url(s) of the upstream endpoint or `file://` paths for static files. Routing is based on the path | |
109+| `-validate-url` | string | Access token validation endpoint | |
110+| `-version` | n/a | print version string | |
111+| `-whitelist-domain` | string \| list | allowed domains for redirection after authentication. Prefix domain with a `.` to allow subdomains (eg `.example.com`) | |
111112
112113Note, when using the `whitelist-domain` option, any domain prefixed with a `.` will allow any subdomain of the specified domain as a valid redirect URL.
113114