fix(api): handle id_token_mapping in generic oidc provider correctly (#6428)

This commit is contained in:
Livio Spring 2023-08-24 12:31:12 +02:00 committed by GitHub
parent bb40e173bd
commit 94d13fd3e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 18 deletions

View File

@ -231,23 +231,25 @@ func updateGenericOAuthProviderToCommand(req *admin_pb.UpdateGenericOAuthProvide
func addGenericOIDCProviderToCommand(req *admin_pb.AddGenericOIDCProviderRequest) command.GenericOIDCProvider { func addGenericOIDCProviderToCommand(req *admin_pb.AddGenericOIDCProviderRequest) command.GenericOIDCProvider {
return command.GenericOIDCProvider{ return command.GenericOIDCProvider{
Name: req.Name, Name: req.Name,
Issuer: req.Issuer, Issuer: req.Issuer,
ClientID: req.ClientId, ClientID: req.ClientId,
ClientSecret: req.ClientSecret, ClientSecret: req.ClientSecret,
Scopes: req.Scopes, Scopes: req.Scopes,
IDPOptions: idp_grpc.OptionsToCommand(req.ProviderOptions), IsIDTokenMapping: req.IsIdTokenMapping,
IDPOptions: idp_grpc.OptionsToCommand(req.ProviderOptions),
} }
} }
func updateGenericOIDCProviderToCommand(req *admin_pb.UpdateGenericOIDCProviderRequest) command.GenericOIDCProvider { func updateGenericOIDCProviderToCommand(req *admin_pb.UpdateGenericOIDCProviderRequest) command.GenericOIDCProvider {
return command.GenericOIDCProvider{ return command.GenericOIDCProvider{
Name: req.Name, Name: req.Name,
Issuer: req.Issuer, Issuer: req.Issuer,
ClientID: req.ClientId, ClientID: req.ClientId,
ClientSecret: req.ClientSecret, ClientSecret: req.ClientSecret,
Scopes: req.Scopes, Scopes: req.Scopes,
IDPOptions: idp_grpc.OptionsToCommand(req.ProviderOptions), IsIDTokenMapping: req.IsIdTokenMapping,
IDPOptions: idp_grpc.OptionsToCommand(req.ProviderOptions),
} }
} }

View File

@ -260,12 +260,13 @@ func addGenericOIDCProviderToCommand(req *mgmt_pb.AddGenericOIDCProviderRequest)
func updateGenericOIDCProviderToCommand(req *mgmt_pb.UpdateGenericOIDCProviderRequest) command.GenericOIDCProvider { func updateGenericOIDCProviderToCommand(req *mgmt_pb.UpdateGenericOIDCProviderRequest) command.GenericOIDCProvider {
return command.GenericOIDCProvider{ return command.GenericOIDCProvider{
Name: req.Name, Name: req.Name,
Issuer: req.Issuer, Issuer: req.Issuer,
ClientID: req.ClientId, ClientID: req.ClientId,
ClientSecret: req.ClientSecret, ClientSecret: req.ClientSecret,
Scopes: req.Scopes, Scopes: req.Scopes,
IDPOptions: idp_grpc.OptionsToCommand(req.ProviderOptions), IsIDTokenMapping: req.IsIdTokenMapping,
IDPOptions: idp_grpc.OptionsToCommand(req.ProviderOptions),
} }
} }