@@ -35,28 +35,39 @@ class ApiInitializer implements AuthorizationServiceProviderInterface
3535 public function getAuthenticationService (): AuthenticationService
3636 {
3737 $ service = new AuthenticationService ();
38- $ service ->loadIdentifier ('Authentication.JwtSubject ' , []);
39- $ service ->loadIdentifier ('Authentication.Password ' , [
40- 'resolver ' => [
41- 'className ' => 'Authentication.Orm ' ,
42- 'userModel ' => 'CakeDC/Users.Users ' ,
43- 'finder ' => 'active ' ,
44- ],
45- ]);
4638
4739 $ service ->loadAuthenticator ('Authentication.Session ' , [
4840 'sessionKey ' => 'Auth ' ,
41+ 'identifier ' => [
42+ 'Authentication.Password ' => [
43+ 'resolver ' => [
44+ 'className ' => 'Authentication.Orm ' ,
45+ 'userModel ' => 'CakeDC/Users.Users ' ,
46+ 'finder ' => 'active ' ,
47+ ],
48+ ],
49+ ],
4950 ]);
5051 $ service ->loadAuthenticator ('CakeDC/Auth.Form ' , [
51- // 'sessionKey' => 'Auth',
52+ 'identifier ' => [
53+ 'Authentication.Password ' => [
54+ 'resolver ' => [
55+ 'className ' => 'Authentication.Orm ' ,
56+ 'userModel ' => 'CakeDC/Users.Users ' ,
57+ 'finder ' => 'active ' ,
58+ ],
59+ ],
60+ ],
5261 ]);
5362
54- $ service ->loadIdentifier ('Authentication.Token ' , [
55- 'dataField ' => 'token ' ,
56- 'tokenField ' => 'api_token ' ,
57- ]);
5863 $ service ->loadAuthenticator ('Authentication.Token ' , [
5964 'queryParam ' => 'token ' ,
65+ 'identifier ' => [
66+ 'Authentication.Token ' => [
67+ 'dataField ' => 'token ' ,
68+ 'tokenField ' => 'api_token ' ,
69+ ],
70+ ],
6071 ]);
6172
6273 $ service ->loadAuthenticator ('Authentication.Jwt ' , [
@@ -66,6 +77,9 @@ public function getAuthenticationService(): AuthenticationService
6677 'algorithm ' => 'HS512 ' ,
6778 'returnPayload ' => false ,
6879 'secretKey ' => Configure::read ('Api.Jwt.AccessToken.secret ' ),
80+ 'identifier ' => [
81+ 'Authentication.JwtSubject ' => [],
82+ ],
6983 ]);
7084
7185 return $ service ;
0 commit comments