Skip to content

Commit f1b15ff

Browse files
authored
feat: skip nonce check for Facebook Limited Login auth (#2082)
## What kind of change does this PR introduce? nonce matching isn't supported for facebook limited login, skipping it during OIDC login. finalizes #2046
1 parent 48aa34c commit f1b15ff

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

internal/api/token_oidc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ func (p *IdTokenGrantParams) getProvider(ctx context.Context, config *conf.Globa
7878

7979
case p.Provider == "facebook" || p.Issuer == provider.IssuerFacebook:
8080
cfg = &config.External.Facebook
81+
// Facebook (Limited Login) nonce check is not supported
82+
cfg.SkipNonceCheck = true
8183
providerType = "facebook"
8284
issuer = provider.IssuerFacebook
8385
acceptableClientIDs = append(acceptableClientIDs, config.External.Facebook.ClientID...)

internal/conf/configuration.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ func (t *Time) UnmarshalText(text []byte) error {
5959

6060
// OAuthProviderConfiguration holds all config related to external account providers.
6161
type OAuthProviderConfiguration struct {
62-
ClientID []string `json:"client_id" split_words:"true"`
63-
Secret string `json:"secret"`
64-
RedirectURI string `json:"redirect_uri" split_words:"true"`
65-
URL string `json:"url"`
66-
ApiURL string `json:"api_url" split_words:"true"`
67-
Enabled bool `json:"enabled"`
68-
SkipNonceCheck bool `json:"skip_nonce_check" split_words:"true"`
62+
ClientID []string `json:"client_id" split_words:"true"`
63+
Secret string `json:"secret"`
64+
RedirectURI string `json:"redirect_uri" split_words:"true"`
65+
URL string `json:"url"`
66+
ApiURL string `json:"api_url" split_words:"true"`
67+
Enabled bool `json:"enabled"`
68+
// SkipNonceCheck bypasses nonce verification during OIDC token validation.
69+
// Note: Nonce verification helps prevent replay attacks; only disable when necessary.
70+
SkipNonceCheck bool `json:"skip_nonce_check" split_words:"true"`
6971
}
7072

7173
type AnonymousProviderConfiguration struct {

0 commit comments

Comments
 (0)