Download the PHP package feriatos/api-key-bundle without Composer
On this page you can find all versions of the php package feriatos/api-key-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download feriatos/api-key-bundle
More information about feriatos/api-key-bundle
Files in feriatos/api-key-bundle
Package api-key-bundle
Short Description Creates an avenue for using ApiKey authentication for Symfony2. Requires FOSUserBundle.
License Apache 2.0
Informations about the package api-key-bundle
ApiKey Bundle
Creates an avenue for using ApiKey authentication for Symfony2. Requires FOSUserBundle.
Installation
Requires composer, install as follows
Enable Bundle
Place in your AppKernel.php
to enable the bundle
Configuration
You can change how the API key should be delivered and the name of the parameter its sent as. By default, this bundle looks for api_key
in the query string.
Update user provider
This bundle provides two ways to work with User model:
- use model and user provider provided by this bundle
- use custom user provider
Use model provided by this bundle
Entities
Assuming you already have a User
class that extends the FOSUserBundle
's base user model,
change that extend, so its extending Uecode\Bundle\ApiKeyBundle\Model\ApiKeyUser
Then update your schema.
Change used user provider
In your security, change your provider to the service uecode.api_key.provider.user_provider
Use custom user provider
To work with this bundle your user provider should implement . It consist of one method for loading user by their apiKey. You should implement this interface for user provider which used in your api firewall:
Change security settings
You can now add api_key: true
, and stateless: true
to any of your firewalls.
For Example:
All versions of api-key-bundle with dependencies
symfony/symfony Version >=2.3.0
friendsofsymfony/user-bundle Version ~2.0@dev