mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-06 13:36:54 +00:00
More unit tests and small error handling changes for OIDC password grant
This commit is contained in:
@@ -73,7 +73,7 @@ func (p *ProviderConfig) AllowsPasswordGrant() bool {
|
||||
func (p *ProviderConfig) PasswordCredentialsGrantAndValidateTokens(ctx context.Context, username, password string) (*oidctypes.Token, error) {
|
||||
// Disallow this grant when requested.
|
||||
if !p.AllowPasswordGrant {
|
||||
return nil, fmt.Errorf("resource owner password grant is not allowed for this upstream provider according to its configuration")
|
||||
return nil, fmt.Errorf("resource owner password credentials grant is not allowed for this upstream provider according to its configuration")
|
||||
}
|
||||
|
||||
// Note that this implicitly uses the scopes from p.Config.Scopes.
|
||||
|
||||
@@ -147,7 +147,7 @@ func TestProviderConfig(t *testing.T) {
|
||||
{
|
||||
name: "password grant not allowed",
|
||||
disallowPasswordGrant: true, // password grant is not allowed in this ProviderConfig
|
||||
wantErr: "resource owner password grant is not allowed for this upstream provider according to its configuration",
|
||||
wantErr: "resource owner password credentials grant is not allowed for this upstream provider according to its configuration",
|
||||
},
|
||||
{
|
||||
name: "token request fails with http error",
|
||||
|
||||
Reference in New Issue
Block a user