You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default configuration for Auth.AuthenticationComponent is:
31
+
32
+
The default configuration for ``Auth.AuthenticationComponent`` is:
31
33
32
34
```php
33
35
[
@@ -37,28 +39,30 @@ The default configuration for Auth.AuthenticationComponent is:
37
39
]
38
40
```
39
41
40
-
[Check the component options at the it's source code for more infomation](https://github.com/cakephp/authentication/blob/master/src/Controller/Component/AuthenticationComponent.php#L38)
42
+
Check [the component options at the its source code](https://github.com/cakephp/authentication/blob/master/src/Controller/Component/AuthenticationComponent.php#L38) for more infomation.
41
43
42
44
Authenticators
43
45
--------------
44
46
45
-
The cakephp/authentication plugin provides the main structure for the authenticators used in this plugin,
47
+
The ``cakephp/authentication`` plugin provides the main structure for the authenticators used in this plugin,
46
48
we also use some custom authenticators to work with social providers, reCaptcha and cookie. The default
47
49
list of authenticators includes:
48
50
49
-
- 'Authentication.Session'
50
-
- 'CakeDC/Auth.Form'
51
-
- 'Authentication.Token'
52
-
- 'CakeDC/Auth.Cookie'
53
-
- 'CakeDC/Users.Social'//Works with SocialAuthMiddleware
54
-
- 'CakeDC/Users.SocialPendingEmail'
51
+
-``Authentication.Session``
52
+
-``CakeDC/Auth.Form``
53
+
-``Authentication.Token``
54
+
-``CakeDC/Auth.Cookie``
55
+
-``CakeDC/Users.Social`` which works with the ``SocialAuthMiddleware``
56
+
-``CakeDC/Users.SocialPendingEmail``
57
+
58
+
If you enable ``OneTimePasswordAuthenticator.login`` we also load the ``CakeDC/Auth.TwoFactor``
55
59
56
-
**If you enable 'OneTimePasswordAuthenticator.login' we also load the CakeDC/Auth.TwoFactor**
60
+
These authenticators should be enough for your application, but you can easily customize it
61
+
setting the ``Auth.Authenticators`` config key.
57
62
58
-
These authenticators should be enough for your application, but you easily customize it
59
-
setting the Auth.Authenticators config key.
63
+
These authenticators are loaded by the ``\CakeDC\Users\Loader\AuthenticationServiceLoader`` class in the ``loadAuthenticators`` method. See [Authentication Service Loader](#authentication-service-loader) on how to adjust it to your needs.
60
64
61
-
For example if you add JWT authenticator you must add this to your config/users.php file:
65
+
For example, if you want to add the JWT authenticator you must add the following to your ``config/users.php`` file:
62
66
63
67
```php
64
68
'Auth.Authenticators.Jwt' => [
@@ -68,26 +72,20 @@ For example if you add JWT authenticator you must add this to your config/users.
68
72
],
69
73
```
70
74
71
-
**You may have noticed the 'skipTwoFactorVerify' option, this option is used to identify if a authenticator should skip
72
-
the two factor flow**
73
-
74
-
The authenticators are loaded by \CakeDC\Users\Loader\AuthenticationServiceLoader class at load authentication
75
-
service method from plugin object.
76
-
77
-
See the full Auth.Authenticators at config/users.php
75
+
The ``skipTwoFactorVerify`` option is used to skip the two factor flow for a given authenticator
78
76
79
77
Identifiers
80
78
-----------
81
-
The identifies are defined to work correctly with the default authenticators, we are using these identifiers:
82
79
83
-
- Authentication.Password, for Form authenticator
84
-
- CakeDC/Users.Social, for Social and SocialPendingEmail authenticators
85
-
- Authentication.Token, for TokenAuthenticator
80
+
The identifiers are defined to work correctly with the default authenticators, we are using these identifiers:
86
81
87
-
As you add more authenticators you may need to add identifiers, please check identifiers available at
-``Authentication.Password``, for ``Form`` authenticator
83
+
-``CakeDC/Users.Social``, for ``Social`` and ``SocialPendingEmail`` authenticators
84
+
-``Authentication.Token``, for ``Token`` authenticator
89
85
90
-
The default value for Auth.Identifiers is:
86
+
As you add more authenticators you may also need to add other identifiers, please see [the identifiers available in the official CakePHP Authentication plugin documentation](https://book.cakephp.org/authentication/2/en/identifiers.html).
87
+
88
+
The default list for ``Auth.Identifiers`` is:
91
89
92
90
```php
93
91
[
@@ -116,24 +114,25 @@ The default value for Auth.Identifiers is:
116
114
]
117
115
]
118
116
```
119
-
The identifiers are loaded by \CakeDC\Users\Loader\AuthenticationServiceLoader class at load authentication
120
-
service method from plugin object.
121
117
118
+
These identifiers are loaded by the ``\CakeDC\Users\Loader\AuthenticationServiceLoader`` class in the ``loadIdentifiers`` method. See [Authentication Service Loader](#authentication-service-loader) on how to adjust it to your needs.
122
119
123
120
Handling Login Result
124
121
---------------------
125
-
For both form login and social login we use a base component 'CakeDC/Users.Login' to handle login,
126
-
it check the result of authentication service to redirect user to a internal page or show an authentication
127
-
error. It provide some error messages for specific authentication result status, please check the config/users.php file.
128
122
129
-
To use a custom component to handle the login you should update your config/users.php file with:
123
+
For both form login and social login we use a base component ``CakeDC/Users.Login`` to handle the login.
124
+
It checks the result of the authentication service and either redirects the user or shows an authentication
125
+
error. It provides some error messages for specific authentication results. Please check the ``config/users.php`` file.
126
+
127
+
To use a custom component to handle the login you should update your ``config/users.php`` file with:
0 commit comments