@ -62,6 +62,11 @@ type Config struct {
// This setting allows you to override the default behavior of Dex and enforce the mappings defined in `claimMapping`.
// This setting allows you to override the default behavior of Dex and enforce the mappings defined in `claimMapping`.
OverrideClaimMapping bool ` json:"overrideClaimMapping" ` // defaults to false
OverrideClaimMapping bool ` json:"overrideClaimMapping" ` // defaults to false
// ForceQueryResponseModeSet ensures the `response_mode` query parameter to be explicitly set in the LoginURL.
// Although the OIDC specification defines query to be the default,
// some implementations require this parameter to be set in order to deliver the code as a query.
ForceQueryResponseMode bool ` json:"forceQueryResponseMode" `
ClaimMapping struct {
ClaimMapping struct {
// Configurable key which contains the preferred username claims
// Configurable key which contains the preferred username claims
PreferredUsernameKey string ` json:"preferred_username" ` // defaults to "preferred_username"
PreferredUsernameKey string ` json:"preferred_username" ` // defaults to "preferred_username"
@ -160,6 +165,7 @@ func (c *Config) Open(id string, logger log.Logger) (conn connector.Connector, e
userIDKey : c . UserIDKey ,
userIDKey : c . UserIDKey ,
userNameKey : c . UserNameKey ,
userNameKey : c . UserNameKey ,
overrideClaimMapping : c . OverrideClaimMapping ,
overrideClaimMapping : c . OverrideClaimMapping ,
forceQueryResponseMode : c . ForceQueryResponseMode ,
preferredUsernameKey : c . ClaimMapping . PreferredUsernameKey ,
preferredUsernameKey : c . ClaimMapping . PreferredUsernameKey ,
emailKey : c . ClaimMapping . EmailKey ,
emailKey : c . ClaimMapping . EmailKey ,
groupsKey : c . ClaimMapping . GroupsKey ,
groupsKey : c . ClaimMapping . GroupsKey ,
@ -186,6 +192,7 @@ type oidcConnector struct {
userIDKey string
userIDKey string
userNameKey string
userNameKey string
overrideClaimMapping bool
overrideClaimMapping bool
forceQueryResponseMode bool
preferredUsernameKey string
preferredUsernameKey string
emailKey string
emailKey string
groupsKey string
groupsKey string
@ -208,6 +215,10 @@ func (c *oidcConnector) LoginURL(s connector.Scopes, callbackURL, state string)
opts = append ( opts , oauth2 . SetAuthURLParam ( "acr_values" , acrValues ) )
opts = append ( opts , oauth2 . SetAuthURLParam ( "acr_values" , acrValues ) )
}
}
if c . forceQueryResponseMode {
opts = append ( opts , oauth2 . SetAuthURLParam ( "response_mode" , "query" ) )
}
if s . OfflineAccess {
if s . OfflineAccess {
opts = append ( opts , oauth2 . AccessTypeOffline , oauth2 . SetAuthURLParam ( "prompt" , c . promptType ) )
opts = append ( opts , oauth2 . AccessTypeOffline , oauth2 . SetAuthURLParam ( "prompt" , c . promptType ) )
}
}