bleicker / authentication
There is no license information available for the latest version (2.2.0) of this package.
2.2.0
2015-05-11 20:37 UTC
Requires
- bleicker/session: 1.0.*
- bleicker/token: 2.2.*
- doctrine/collections: ~1.2
Requires (Dev)
README
TokenManager
The AuthenticationManager requires a TokenManager. Just register your own or use the default TokenManager:
ObjectManager::register(TokenManagerInterface::class, new TokenManager());
AuthenticationManager
Creating AuthenticationManager Instance:
$authenticationManager = new AuthenticationManager();
Register a prototype token
Authentication state lives as long as runtime.
$authenticationManager->getTokenManager()->registerPrototypeToken(MyPrototypeToken::class, new MyPrototypeToken());
Register a session token
Authentication state will exists along the runtime.
$authenticationManager->getTokenManager()->registerSessionToken(MySessioinToken::class, new MySessioinToken());
Getting authentication state of a Token
$authenticationManager->getTokenManager()->getToken(MyPrototypeToken::class)->status();
Run Authentication
Run the authentication. In this case any registered Token tries to authenticate.
$authenticationManager->run();