@@ -98,44 +98,45 @@ public function getAuthenticationService(ServerRequestInterface $request): Authe
9898 AbstractIdentifier::CREDENTIAL_USERNAME => 'email ' ,
9999 AbstractIdentifier::CREDENTIAL_PASSWORD => 'password ' ,
100100 ],
101- 'loginUrl ' => '/test/login.json '
101+ 'loginUrl ' => '/test/login.json ' ,
102+ 'identifier ' => [
103+ 'Authentication.Password ' => [
104+ 'fields ' => [
105+ AbstractIdentifier::CREDENTIAL_USERNAME => 'email ' ,
106+ AbstractIdentifier::CREDENTIAL_PASSWORD => 'password ' ,
107+ ],
108+ 'resolver ' => [
109+ 'className ' => 'Authentication.Orm ' ,
110+ 'userModel ' => 'Users ' ,
111+ ],
112+ 'passwordHasher ' => [
113+ 'className ' => 'Authentication.Fallback ' ,
114+ 'hashers ' => [
115+ 'Authentication.Default ' ,
116+ [
117+ 'className ' => 'Authentication.Legacy ' ,
118+ 'hashType ' => 'md5 ' ,
119+ ],
120+ ],
121+ ],
122+ ],
123+ ],
102124 ]);
103125
104- $ service ->loadIdentifier ('Authentication.JwtSubject ' );
105-
106126 if (str_starts_with (haystack: $ config ->getAlg (), needle: 'HS ' )) {
107127 $ service ->loadAuthenticator ('Authentication.Jwt ' , [
108128 'secretKey ' => $ config ->getSecret (),
109129 'algorithm ' => $ config ->getAlg (),
130+ 'identifier ' => 'Authentication.JwtSubject ' ,
110131 ]);
111132 } else if (str_starts_with (haystack: $ config ->getAlg (), needle: 'RS ' )) {
112133 $ service ->loadAuthenticator ('Authentication.Jwt ' , [
113134 'jwks ' => (new JwkSet )->getKeySet (),
114135 'algorithm ' => $ config ->getAlg (),
136+ 'identifier ' => 'Authentication.JwtSubject ' ,
115137 ]);
116138 }
117139
118- $ service ->loadIdentifier ('Authentication.Password ' , [
119- 'fields ' => [
120- AbstractIdentifier::CREDENTIAL_USERNAME => 'email ' ,
121- AbstractIdentifier::CREDENTIAL_PASSWORD => 'password ' ,
122- ],
123- 'resolver ' => [
124- 'className ' => 'Authentication.Orm ' ,
125- 'userModel ' => 'Users ' ,
126- ],
127- 'passwordHasher ' => [
128- 'className ' => 'Authentication.Fallback ' ,
129- 'hashers ' => [
130- 'Authentication.Default ' ,
131- [
132- 'className ' => 'Authentication.Legacy ' ,
133- 'hashType ' => 'md5 ' ,
134- ],
135- ],
136- ],
137- ]);
138-
139140 return $ service ;
140141 }
141142}
0 commit comments