@@ -528,7 +528,9 @@ type LegacyProvider struct {
528528 JWTKeyFile string `flag:"jwt-key-file" cfg:"jwt_key_file"`
529529 PubJWKURL string `flag:"pubjwk-url" cfg:"pubjwk_url"`
530530 // PKCE Code Challenge method to use (either S256 or plain)
531− CodeChallengeMethod string `flag:"code-challenge-method" cfg:"force_code_challenge_method"`
531+ CodeChallengeMethod string `flag:"code-challenge-method" cfg:"code_challenge_method"`
532+ // Provided for legacy reasons, to be dropped in newer version see #1667
533+ ForceCodeChallengeMethod string `flag:"force-code-challenge-method" cfg:"force_code_challenge_method"`
532534}
533535
534536func legacyProviderFlagSet() *pflag.FlagSet {
@@ -574,6 +576,7 @@ func legacyProviderFlagSet() *pflag.FlagSet {
574576 flagSet.String("prompt", "", "OIDC prompt")
575577 flagSet.String("approval-prompt", "force", "OAuth approval_prompt")
576578 flagSet.String("code-challenge-method", "", "use PKCE code challenges with the specified method. Either 'plain' or 'S256'")
579+ flagSet.String("force-code-challenge-method", "", "Deprecated - use --code-challenge-method")
577580
578581 flagSet.String("acr-values", "", "acr values string: optional")
579582 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")
@@ -665,6 +668,11 @@ func (l *LegacyProvider) convert() (Providers, error) {
665668 ExtraAudiences: l.OIDCExtraAudiences,
666669 }
667670
671+ // Support for legacy configuration option
672+ if l.ForceCodeChallengeMethod != "" && l.CodeChallengeMethod == "" {
673+ provider.CodeChallengeMethod = l.ForceCodeChallengeMethod
674+ }
675+
668676 // This part is out of the switch section because azure has a default tenant
669677 // that needs to be added from legacy options
670678 provider.AzureConfig = AzureOptions{