ozznest / token-authenticator
Symfony bundle to allow you token based authentication
Package info
github.com/ozznest/TokenAuthenticatorBundle
Type:symfony-bundle
pkg:composer/ozznest/token-authenticator
1.3.1
2021-10-25 09:40 UTC
Requires
- php: >=5.5
- symfony/framework-bundle: ~2.3|~3.0|~4.0|~5.0
README
This bundle allow you to use a token authentication mechanism similar to OAuth but much more simplified.
Installation
First, enable bundle in your AppKernel by adding it to the registerBundles method:
... new Youshido\TokenAuthenticationBundle\TokenAuthenticationBundle(),
Then create provider and firewall under app/config/security.yml (if you don't have encoder yet – might as well add it here):
security: providers: api_user_provider: id: token_user_provider encoders: AppBundle\Entity\User: md5 firewalls: api_firewall: pattern: ^/.* stateless: true simple_preauth: authenticator: token_authenticator provider: api_user_provider anonymous: ~
Now add your model class name to the service declaration app/config/config.yml:
token_authentication: user_model: "AppBundle\\Entity\\User"