@@ -0,0 +1,340 @@
1+package options
2+
3+import (
4+ "crypto"
5+ "net/url"
6+ "regexp"
7+ "time"
8+
9+ oidc "github.com/coreos/go-oidc"
10+ ipapi "github.com/oauth2-proxy/oauth2-proxy/pkg/apis/ip"
11+ sessionsapi "github.com/oauth2-proxy/oauth2-proxy/pkg/apis/sessions"
12+ "github.com/oauth2-proxy/oauth2-proxy/pkg/logger"
13+ "github.com/oauth2-proxy/oauth2-proxy/providers"
14+ "github.com/spf13/pflag"
15+)
16+
17+// SignatureData holds hmacauth signature hash and key
18+type SignatureData struct {
19+ Hash crypto.Hash
20+ Key string
21+}
22+
23+// Options holds Configuration Options that can be set by Command Line Flag,
24+// or Config File
25+type Options struct {
26+ ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix"`
27+ PingPath string `flag:"ping-path" cfg:"ping_path"`
28+ ProxyWebSockets bool `flag:"proxy-websockets" cfg:"proxy_websockets"`
29+ HTTPAddress string `flag:"http-address" cfg:"http_address"`
30+ HTTPSAddress string `flag:"https-address" cfg:"https_address"`
31+ ReverseProxy bool `flag:"reverse-proxy" cfg:"reverse_proxy"`
32+ RealClientIPHeader string `flag:"real-client-ip-header" cfg:"real_client_ip_header"`
33+ ForceHTTPS bool `flag:"force-https" cfg:"force_https"`
34+ RawRedirectURL string `flag:"redirect-url" cfg:"redirect_url"`
35+ ClientID string `flag:"client-id" cfg:"client_id"`
36+ ClientSecret string `flag:"client-secret" cfg:"client_secret"`
37+ ClientSecretFile string `flag:"client-secret-file" cfg:"client_secret_file"`
38+ TLSCertFile string `flag:"tls-cert-file" cfg:"tls_cert_file"`
39+ TLSKeyFile string `flag:"tls-key-file" cfg:"tls_key_file"`
40+
41+ AuthenticatedEmailsFile string `flag:"authenticated-emails-file" cfg:"authenticated_emails_file"`
42+ KeycloakGroup string `flag:"keycloak-group" cfg:"keycloak_group"`
43+ AzureTenant string `flag:"azure-tenant" cfg:"azure_tenant"`
44+ BitbucketTeam string `flag:"bitbucket-team" cfg:"bitbucket_team"`
45+ BitbucketRepository string `flag:"bitbucket-repository" cfg:"bitbucket_repository"`
46+ EmailDomains []string `flag:"email-domain" cfg:"email_domains"`
47+ WhitelistDomains []string `flag:"whitelist-domain" cfg:"whitelist_domains"`
48+ GitHubOrg string `flag:"github-org" cfg:"github_org"`
49+ GitHubTeam string `flag:"github-team" cfg:"github_team"`
50+ GitHubRepo string `flag:"github-repo" cfg:"github_repo"`
51+ GitHubToken string `flag:"github-token" cfg:"github_token"`
52+ GitLabGroup string `flag:"gitlab-group" cfg:"gitlab_group"`
53+ GoogleGroups []string `flag:"google-group" cfg:"google_group"`
54+ GoogleAdminEmail string `flag:"google-admin-email" cfg:"google_admin_email"`
55+ GoogleServiceAccountJSON string `flag:"google-service-account-json" cfg:"google_service_account_json"`
56+ HtpasswdFile string `flag:"htpasswd-file" cfg:"htpasswd_file"`
57+ DisplayHtpasswdForm bool `flag:"display-htpasswd-form" cfg:"display_htpasswd_form"`
58+ CustomTemplatesDir string `flag:"custom-templates-dir" cfg:"custom_templates_dir"`
59+ Banner string `flag:"banner" cfg:"banner"`
60+ Footer string `flag:"footer" cfg:"footer"`
61+
62+ Cookie CookieOptions `cfg:",squash"`
63+ Session SessionOptions `cfg:",squash"`
64+
65+ Upstreams []string `flag:"upstream" cfg:"upstreams"`
66+ SkipAuthRegex []string `flag:"skip-auth-regex" cfg:"skip_auth_regex"`
67+ SkipJwtBearerTokens bool `flag:"skip-jwt-bearer-tokens" cfg:"skip_jwt_bearer_tokens"`
68+ ExtraJwtIssuers []string `flag:"extra-jwt-issuers" cfg:"extra_jwt_issuers"`
69+ PassBasicAuth bool `flag:"pass-basic-auth" cfg:"pass_basic_auth"`
70+ SetBasicAuth bool `flag:"set-basic-auth" cfg:"set_basic_auth"`
71+ PreferEmailToUser bool `flag:"prefer-email-to-user" cfg:"prefer_email_to_user"`
72+ BasicAuthPassword string `flag:"basic-auth-password" cfg:"basic_auth_password"`
73+ PassAccessToken bool `flag:"pass-access-token" cfg:"pass_access_token"`
74+ PassHostHeader bool `flag:"pass-host-header" cfg:"pass_host_header"`
75+ SkipProviderButton bool `flag:"skip-provider-button" cfg:"skip_provider_button"`
76+ PassUserHeaders bool `flag:"pass-user-headers" cfg:"pass_user_headers"`
77+ SSLInsecureSkipVerify bool `flag:"ssl-insecure-skip-verify" cfg:"ssl_insecure_skip_verify"`
78+ SSLUpstreamInsecureSkipVerify bool `flag:"ssl-upstream-insecure-skip-verify" cfg:"ssl_upstream_insecure_skip_verify"`
79+ SetXAuthRequest bool `flag:"set-xauthrequest" cfg:"set_xauthrequest"`
80+ SetAuthorization bool `flag:"set-authorization-header" cfg:"set_authorization_header"`
81+ PassAuthorization bool `flag:"pass-authorization-header" cfg:"pass_authorization_header"`
82+ SkipAuthPreflight bool `flag:"skip-auth-preflight" cfg:"skip_auth_preflight"`
83+ FlushInterval time.Duration `flag:"flush-interval" cfg:"flush_interval"`
84+
85+ // These options allow for other providers besides Google, with
86+ // potential overrides.
87+ ProviderType string `flag:"provider" cfg:"provider"`
88+ ProviderName string `flag:"provider-display-name" cfg:"provider_display_name"`
89+ OIDCIssuerURL string `flag:"oidc-issuer-url" cfg:"oidc_issuer_url"`
90+ InsecureOIDCAllowUnverifiedEmail bool `flag:"insecure-oidc-allow-unverified-email" cfg:"insecure_oidc_allow_unverified_email"`
91+ InsecureOIDCSkipIssuerVerification bool `flag:"insecure-oidc-skip-issuer-verification" cfg:"insecure_oidc_skip_issuer_verification"`
92+ SkipOIDCDiscovery bool `flag:"skip-oidc-discovery" cfg:"skip_oidc_discovery"`
93+ OIDCJwksURL string `flag:"oidc-jwks-url" cfg:"oidc_jwks_url"`
94+ LoginURL string `flag:"login-url" cfg:"login_url"`
95+ RedeemURL string `flag:"redeem-url" cfg:"redeem_url"`
96+ ProfileURL string `flag:"profile-url" cfg:"profile_url"`
97+ ProtectedResource string `flag:"resource" cfg:"resource"`
98+ ValidateURL string `flag:"validate-url" cfg:"validate_url"`
99+ Scope string `flag:"scope" cfg:"scope"`
100+ Prompt string `flag:"prompt" cfg:"prompt"`
101+ ApprovalPrompt string `flag:"approval-prompt" cfg:"approval_prompt"` // Deprecated by OIDC 1.0
102+ UserIDClaim string `flag:"user-id-claim" cfg:"user_id_claim"`
103+
104+ // Configuration values for logging
105+ LoggingFilename string `flag:"logging-filename" cfg:"logging_filename"`
106+ LoggingMaxSize int `flag:"logging-max-size" cfg:"logging_max_size"`
107+ LoggingMaxAge int `flag:"logging-max-age" cfg:"logging_max_age"`
108+ LoggingMaxBackups int `flag:"logging-max-backups" cfg:"logging_max_backups"`
109+ LoggingLocalTime bool `flag:"logging-local-time" cfg:"logging_local_time"`
110+ LoggingCompress bool `flag:"logging-compress" cfg:"logging_compress"`
111+ StandardLogging bool `flag:"standard-logging" cfg:"standard_logging"`
112+ StandardLoggingFormat string `flag:"standard-logging-format" cfg:"standard_logging_format"`
113+ RequestLogging bool `flag:"request-logging" cfg:"request_logging"`
114+ RequestLoggingFormat string `flag:"request-logging-format" cfg:"request_logging_format"`
115+ ExcludeLoggingPaths string `flag:"exclude-logging-paths" cfg:"exclude_logging_paths"`
116+ SilencePingLogging bool `flag:"silence-ping-logging" cfg:"silence_ping_logging"`
117+ AuthLogging bool `flag:"auth-logging" cfg:"auth_logging"`
118+ AuthLoggingFormat string `flag:"auth-logging-format" cfg:"auth_logging_format"`
119+ SignatureKey string `flag:"signature-key" cfg:"signature_key"`
120+ AcrValues string `flag:"acr-values" cfg:"acr_values"`
121+ JWTKey string `flag:"jwt-key" cfg:"jwt_key"`
122+ JWTKeyFile string `flag:"jwt-key-file" cfg:"jwt_key_file"`
123+ PubJWKURL string `flag:"pubjwk-url" cfg:"pubjwk_url"`
124+ GCPHealthChecks bool `flag:"gcp-healthchecks" cfg:"gcp_healthchecks"`
125+
126+ // internal values that are set after config validation
127+ redirectURL *url.URL
128+ proxyURLs []*url.URL
129+ compiledRegex []*regexp.Regexp
130+ provider providers.Provider
131+ sessionStore sessionsapi.SessionStore
132+ signatureData *SignatureData
133+ oidcVerifier *oidc.IDTokenVerifier
134+ jwtBearerVerifiers []*oidc.IDTokenVerifier
135+ realClientIPParser ipapi.RealClientIPParser
136+}
137+
138+// Options for Getting internal values
139+func (o *Options) GetRedirectURL() *url.URL { return o.redirectURL }
140+func (o *Options) GetProxyURLs() []*url.URL { return o.proxyURLs }
141+func (o *Options) GetCompiledRegex() []*regexp.Regexp { return o.compiledRegex }
142+func (o *Options) GetProvider() providers.Provider { return o.provider }
143+func (o *Options) GetSessionStore() sessionsapi.SessionStore { return o.sessionStore }
144+func (o *Options) GetSignatureData() *SignatureData { return o.signatureData }
145+func (o *Options) GetOIDCVerifier() *oidc.IDTokenVerifier { return o.oidcVerifier }
146+func (o *Options) GetJWTBearerVerifiers() []*oidc.IDTokenVerifier { return o.jwtBearerVerifiers }
147+func (o *Options) GetRealClientIPParser() ipapi.RealClientIPParser { return o.realClientIPParser }
148+
149+// Options for Setting internal values
150+func (o *Options) SetRedirectURL(s *url.URL) { o.redirectURL = s }
151+func (o *Options) SetProxyURLs(s []*url.URL) { o.proxyURLs = s }
152+func (o *Options) SetCompiledRegex(s []*regexp.Regexp) { o.compiledRegex = s }
153+func (o *Options) SetProvider(s providers.Provider) { o.provider = s }
154+func (o *Options) SetSessionStore(s sessionsapi.SessionStore) { o.sessionStore = s }
155+func (o *Options) SetSignatureData(s *SignatureData) { o.signatureData = s }
156+func (o *Options) SetOIDCVerifier(s *oidc.IDTokenVerifier) { o.oidcVerifier = s }
157+func (o *Options) SetJWTBearerVerifiers(s []*oidc.IDTokenVerifier) { o.jwtBearerVerifiers = s }
158+func (o *Options) SetRealClientIPParser(s ipapi.RealClientIPParser) { o.realClientIPParser = s }
159+
160+// NewOptions constructs a new Options with defaulted values
161+func NewOptions() *Options {
162+ return &Options{
163+ ProxyPrefix: "/oauth2",
164+ ProviderType: "google",
165+ PingPath: "/ping",
166+ ProxyWebSockets: true,
167+ HTTPAddress: "127.0.0.1:4180",
168+ HTTPSAddress: ":443",
169+ RealClientIPHeader: "X-Real-IP",
170+ ForceHTTPS: false,
171+ DisplayHtpasswdForm: true,
172+ Cookie: CookieOptions{
173+ Name: "_oauth2_proxy",
174+ Secure: true,
175+ HTTPOnly: true,
176+ Expire: time.Duration(168) * time.Hour,
177+ Refresh: time.Duration(0),
178+ Path: "/",
179+ },
180+ Session: SessionOptions{
181+ Type: "cookie",
182+ },
183+ AzureTenant: "common",
184+ SetXAuthRequest: false,
185+ SkipAuthPreflight: false,
186+ FlushInterval: time.Duration(1) * time.Second,
187+ PassBasicAuth: true,
188+ SetBasicAuth: false,
189+ PassUserHeaders: true,
190+ PassAccessToken: false,
191+ PassHostHeader: true,
192+ SetAuthorization: false,
193+ PassAuthorization: false,
194+ PreferEmailToUser: false,
195+ Prompt: "", // Change to "login" when ApprovalPrompt officially deprecated
196+ ApprovalPrompt: "force",
197+ UserIDClaim: "email",
198+ InsecureOIDCAllowUnverifiedEmail: false,
199+ SkipOIDCDiscovery: false,
200+ LoggingFilename: "",
201+ LoggingMaxSize: 100,
202+ LoggingMaxAge: 7,
203+ LoggingMaxBackups: 0,
204+ LoggingLocalTime: true,
205+ LoggingCompress: false,
206+ ExcludeLoggingPaths: "",
207+ SilencePingLogging: false,
208+ StandardLogging: true,
209+ StandardLoggingFormat: logger.DefaultStandardLoggingFormat,
210+ RequestLogging: true,
211+ RequestLoggingFormat: logger.DefaultRequestLoggingFormat,
212+ AuthLogging: true,
213+ AuthLoggingFormat: logger.DefaultAuthLoggingFormat,
214+ }
215+}
216+
217+// NewFlagSet creates a new FlagSet with all of the flags required by Options
218+func NewFlagSet() *pflag.FlagSet {
219+ flagSet := pflag.NewFlagSet("oauth2-proxy", pflag.ExitOnError)
220+
221+ flagSet.String("http-address", "127.0.0.1:4180", "[http://]<addr>:<port> or unix://<path> to listen on for HTTP clients")
222+ flagSet.String("https-address", ":443", "<addr>:<port> to listen on for HTTPS clients")
223+ flagSet.Bool("reverse-proxy", false, "are we running behind a reverse proxy, controls whether headers like X-Real-Ip are accepted")
224+ flagSet.String("real-client-ip-header", "X-Real-IP", "Header used to determine the real IP of the client (one of: X-Forwarded-For, X-Real-IP, or X-ProxyUser-IP)")
225+ flagSet.Bool("force-https", false, "force HTTPS redirect for HTTP requests")
226+ flagSet.String("tls-cert-file", "", "path to certificate file")
227+ flagSet.String("tls-key-file", "", "path to private key file")
228+ flagSet.String("redirect-url", "", "the OAuth Redirect URL. ie: \"https://internalapp.yourcompany.com/oauth2/callback\"")
229+ flagSet.Bool("set-xauthrequest", false, "set X-Auth-Request-User and X-Auth-Request-Email response headers (useful in Nginx auth_request mode)")
230+ flagSet.StringSlice("upstream", []string{}, "the http url(s) of the upstream endpoint, file:// paths for static files or static://<status_code> for static response. Routing is based on the path")
231+ flagSet.Bool("pass-basic-auth", true, "pass HTTP Basic Auth, X-Forwarded-User and X-Forwarded-Email information to upstream")
232+ flagSet.Bool("set-basic-auth", false, "set HTTP Basic Auth information in response (useful in Nginx auth_request mode)")
233+ flagSet.Bool("prefer-email-to-user", false, "Prefer to use the Email address as the Username when passing information to upstream. Will only use Username if Email is unavailable, eg. htaccess authentication. Used in conjunction with -pass-basic-auth and -pass-user-headers")
234+ flagSet.Bool("pass-user-headers", true, "pass X-Forwarded-User and X-Forwarded-Email information to upstream")
235+ flagSet.String("basic-auth-password", "", "the password to set when passing the HTTP Basic Auth header")
236+ flagSet.Bool("pass-access-token", false, "pass OAuth access_token to upstream via X-Forwarded-Access-Token header")
237+ flagSet.Bool("pass-host-header", true, "pass the request Host Header to upstream")
238+ flagSet.Bool("pass-authorization-header", false, "pass the Authorization Header to upstream")
239+ flagSet.Bool("set-authorization-header", false, "set Authorization response headers (useful in Nginx auth_request mode)")
240+ flagSet.StringSlice("skip-auth-regex", []string{}, "bypass authentication for requests path's that match (may be given multiple times)")
241+ flagSet.Bool("skip-provider-button", false, "will skip sign-in-page to directly reach the next step: oauth/start")
242+ flagSet.Bool("skip-auth-preflight", false, "will skip authentication for OPTIONS requests")
243+ flagSet.Bool("ssl-insecure-skip-verify", false, "skip validation of certificates presented when using HTTPS providers")
244+ flagSet.Bool("ssl-upstream-insecure-skip-verify", false, "skip validation of certificates presented when using HTTPS upstreams")
245+ flagSet.Duration("flush-interval", time.Duration(1)*time.Second, "period between response flushing when streaming responses")
246+ flagSet.Bool("skip-jwt-bearer-tokens", false, "will skip requests that have verified JWT bearer tokens (default false)")
247+ flagSet.StringSlice("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)")
248+
249+ flagSet.StringSlice("email-domain", []string{}, "authenticate emails with the specified domain (may be given multiple times). Use * to authenticate any email")
250+ flagSet.StringSlice("whitelist-domain", []string{}, "allowed domains for redirection after authentication. Prefix domain with a . to allow subdomains (eg .example.com)")
251+ flagSet.String("keycloak-group", "", "restrict login to members of this group.")
252+ flagSet.String("azure-tenant", "common", "go to a tenant-specific or common (tenant-independent) endpoint.")
253+ flagSet.String("bitbucket-team", "", "restrict logins to members of this team")
254+ flagSet.String("bitbucket-repository", "", "restrict logins to user with access to this repository")
255+ flagSet.String("github-org", "", "restrict logins to members of this organisation")
256+ flagSet.String("github-team", "", "restrict logins to members of this team")
257+ flagSet.String("github-repo", "", "restrict logins to collaborators of this repository")
258+ flagSet.String("github-token", "", "the token to use when verifying repository collaborators (must have push access to the repository)")
259+ flagSet.String("gitlab-group", "", "restrict logins to members of this group")
260+ flagSet.StringSlice("google-group", []string{}, "restrict logins to members of this google group (may be given multiple times).")
261+ flagSet.String("google-admin-email", "", "the google admin to impersonate for api calls")
262+ flagSet.String("google-service-account-json", "", "the path to the service account json credentials")
263+ flagSet.String("client-id", "", "the OAuth Client ID: ie: \"123456.apps.googleusercontent.com\"")
264+ flagSet.String("client-secret", "", "the OAuth Client Secret")
265+ flagSet.String("client-secret-file", "", "the file with OAuth Client Secret")
266+ flagSet.String("authenticated-emails-file", "", "authenticate against emails via file (one per line)")
267+ flagSet.String("htpasswd-file", "", "additionally authenticate against a htpasswd file. Entries must be created with \"htpasswd -s\" for SHA encryption or \"htpasswd -B\" for bcrypt encryption")
268+ flagSet.Bool("display-htpasswd-form", true, "display username / password login form if an htpasswd file is provided")
269+ flagSet.String("custom-templates-dir", "", "path to custom html templates")
270+ flagSet.String("banner", "", "custom banner string. Use \"-\" to disable default banner.")
271+ flagSet.String("footer", "", "custom footer string. Use \"-\" to disable default footer.")
272+ flagSet.String("proxy-prefix", "/oauth2", "the url root path that this proxy should be nested under (e.g. /<oauth2>/sign_in)")
273+ flagSet.String("ping-path", "/ping", "the ping endpoint that can be used for basic health checks")
274+ flagSet.Bool("proxy-websockets", true, "enables WebSocket proxying")
275+
276+ flagSet.String("cookie-name", "_oauth2_proxy", "the name of the cookie that the oauth_proxy creates")
277+ flagSet.String("cookie-secret", "", "the seed string for secure cookies (optionally base64 encoded)")
278+ flagSet.StringSlice("cookie-domain", []string{}, "Optional cookie domains to force cookies to (ie: `.yourcompany.com`). The longest domain matching the request's host will be used (or the shortest cookie domain if there is no match).")
279+ flagSet.String("cookie-path", "/", "an optional cookie path to force cookies to (ie: /poc/)*")
280+ flagSet.Duration("cookie-expire", time.Duration(168)*time.Hour, "expire timeframe for cookie")
281+ flagSet.Duration("cookie-refresh", time.Duration(0), "refresh the cookie after this duration; 0 to disable")
282+ flagSet.Bool("cookie-secure", true, "set secure (HTTPS) cookie flag")
283+ flagSet.Bool("cookie-httponly", true, "set HttpOnly cookie flag")
284+ flagSet.String("cookie-samesite", "", "set SameSite cookie attribute (ie: \"lax\", \"strict\", \"none\", or \"\"). ")
285+
286+ flagSet.String("session-store-type", "cookie", "the session storage provider to use")
287+ flagSet.String("redis-connection-url", "", "URL of redis server for redis session storage (eg: redis://HOST[:PORT])")
288+ flagSet.Bool("redis-use-sentinel", false, "Connect to redis via sentinels. Must set --redis-sentinel-master-name and --redis-sentinel-connection-urls to use this feature")
289+ flagSet.String("redis-sentinel-master-name", "", "Redis sentinel master name. Used in conjunction with --redis-use-sentinel")
290+ flagSet.String("redis-ca-path", "", "Redis custom CA path")
291+ flagSet.Bool("redis-insecure-skip-tls-verify", false, "Use insecure TLS connection to redis")
292+ flagSet.StringSlice("redis-sentinel-connection-urls", []string{}, "List of Redis sentinel connection URLs (eg redis://HOST[:PORT]). Used in conjunction with --redis-use-sentinel")
293+ flagSet.Bool("redis-use-cluster", false, "Connect to redis cluster. Must set --redis-cluster-connection-urls to use this feature")
294+ flagSet.StringSlice("redis-cluster-connection-urls", []string{}, "List of Redis cluster connection URLs (eg redis://HOST[:PORT]). Used in conjunction with --redis-use-cluster")
295+
296+ flagSet.String("logging-filename", "", "File to log requests to, empty for stdout")
297+ flagSet.Int("logging-max-size", 100, "Maximum size in megabytes of the log file before rotation")
298+ flagSet.Int("logging-max-age", 7, "Maximum number of days to retain old log files")
299+ flagSet.Int("logging-max-backups", 0, "Maximum number of old log files to retain; 0 to disable")
300+ flagSet.Bool("logging-local-time", true, "If the time in log files and backup filenames are local or UTC time")
301+ flagSet.Bool("logging-compress", false, "Should rotated log files be compressed using gzip")
302+
303+ flagSet.Bool("standard-logging", true, "Log standard runtime information")
304+ flagSet.String("standard-logging-format", logger.DefaultStandardLoggingFormat, "Template for standard log lines")
305+
306+ flagSet.Bool("request-logging", true, "Log HTTP requests")
307+ flagSet.String("request-logging-format", logger.DefaultRequestLoggingFormat, "Template for HTTP request log lines")
308+ flagSet.String("exclude-logging-paths", "", "Exclude logging requests to paths (eg: '/path1,/path2,/path3')")
309+ flagSet.Bool("silence-ping-logging", false, "Disable logging of requests to ping endpoint")
310+
311+ flagSet.Bool("auth-logging", true, "Log authentication attempts")
312+ flagSet.String("auth-logging-format", logger.DefaultAuthLoggingFormat, "Template for authentication log lines")
313+
314+ flagSet.String("provider", "google", "OAuth provider")
315+ flagSet.String("provider-display-name", "", "Provider display name")
316+ flagSet.String("oidc-issuer-url", "", "OpenID Connect issuer URL (ie: https://accounts.google.com)")
317+ flagSet.Bool("insecure-oidc-allow-unverified-email", false, "Don't fail if an email address in an id_token is not verified")
318+ flagSet.Bool("insecure-oidc-skip-issuer-verification", false, "Do not verify if issuer matches OIDC discovery URL")
319+ flagSet.Bool("skip-oidc-discovery", false, "Skip OIDC discovery and use manually supplied Endpoints")
320+ flagSet.String("oidc-jwks-url", "", "OpenID Connect JWKS URL (ie: https://www.googleapis.com/oauth2/v3/certs)")
321+ flagSet.String("login-url", "", "Authentication endpoint")
322+ flagSet.String("redeem-url", "", "Token redemption endpoint")
323+ flagSet.String("profile-url", "", "Profile access endpoint")
324+ flagSet.String("resource", "", "The resource that is protected (Azure AD only)")
325+ flagSet.String("validate-url", "", "Access token validation endpoint")
326+ flagSet.String("scope", "", "OAuth scope specification")
327+ flagSet.String("prompt", "", "OIDC prompt")
328+ flagSet.String("approval-prompt", "force", "OAuth approval_prompt")
329+
330+ flagSet.String("signature-key", "", "GAP-Signature request signature key (algorithm:secretkey)")
331+ flagSet.String("acr-values", "", "acr values string: optional")
332+ flagSet.String("jwt-key", "", "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")
333+ flagSet.String("jwt-key-file", "", "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")
334+ flagSet.String("pubjwk-url", "", "JWK pubkey access endpoint: required by login.gov")
335+ flagSet.Bool("gcp-healthchecks", false, "Enable GCP/GKE healthcheck endpoints")
336+
337+ flagSet.String("user-id-claim", "email", "which claim contains the user ID")
338+
339+ return flagSet
340+}