fix: improve login_hint usage on IDPs (#6899)

* only set prompt if no login_hint is set

* update to current state and cleanup
This commit is contained in:
Livio Spring
2023-11-13 10:25:26 +02:00
committed by GitHub
parent 42a2c0093d
commit 0386fe7f96
8 changed files with 85 additions and 59 deletions

View File

@@ -23,7 +23,7 @@ func TestProvider_BeginAuth(t *testing.T) {
encryptionAlg func(t *testing.T) crypto.EncryptionAlgorithm
}
type args struct {
params []any
params []idp.Parameter
}
type want struct {
session idp.Session
@@ -55,28 +55,6 @@ func TestProvider_BeginAuth(t *testing.T) {
},
},
},
{
name: "invalid userAgentID error",
fields: fields{
issuer: "https://jwt.com",
jwtEndpoint: "https://auth.com/jwt",
keysEndpoint: "https://jwt.com/keys",
headerName: "jwt-header",
encryptionAlg: func(t *testing.T) crypto.EncryptionAlgorithm {
return crypto.CreateMockEncryptionAlg(gomock.NewController(t))
},
},
args: args{
params: []any{
0,
},
},
want: want{
err: func(err error) bool {
return errors.Is(err, ErrMissingUserAgentID)
},
},
},
{
name: "successful auth",
fields: fields{
@@ -89,8 +67,8 @@ func TestProvider_BeginAuth(t *testing.T) {
},
},
args: args{
params: []any{
"agent",
params: []idp.Parameter{
idp.UserAgentID("agent"),
},
},
want: want{