The 'user' term is more relevant to a package that implements the Yiisoft\Auth\IdentityInterface interface, whereas the yiisoft/user package implements various authentication methods via the session:
- The
authenticate(ServerRequestInterface $request) method checks if an identity ID is saved in the session.
- The
login(IdentityInterface $identity) method sets an identity ID in the session.
- The
logout() method removes an identity ID from the session.
And so on.
The names 'ApiAuth' and 'WebAuth' do not have to be related to the API or web application.
The AuthenticatorInterface is a universal interface for any application that uses sessions.
As the 'yiisoft/user' package contains many misleading names, including its own, the following names were suggested for the new package:
- 'yiisoft/auth-session' instead of 'yiisoft/user'
- AuthManager instead of CurrentUser
- Authenticator instead of ApiAuth and WebAuth
The AuthManager method names are:
- isAuthenticated() instead of isGuest()
Originally posted by @klsoft-web in yiisoft/docs#514
The 'user' term is more relevant to a package that implements the
Yiisoft\Auth\IdentityInterfaceinterface, whereas theyiisoft/userpackage implements various authentication methods via thesession:authenticate(ServerRequestInterface $request)method checks if an identity ID is saved in thesession.login(IdentityInterface $identity)method sets an identity ID in thesession.logout()method removes an identity ID from thesession.And so on.
The names 'ApiAuth' and 'WebAuth' do not have to be related to the API or web application.
The
AuthenticatorInterfaceis a universal interface for any application that uses sessions.As the 'yiisoft/user' package contains many misleading names, including its own, the following names were suggested for the new package:
The AuthManager method names are:
Originally posted by @klsoft-web in yiisoft/docs#514