mkosiedowski / simple-api-key-bundle
Creates an avenue for using ApiKey app authentication for Symfony2 without user authentication
Installs: 4 975
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.3.0
- doctrine/orm: ^2.5
- symfony/symfony: ^3.3|^4.0
This package is auto-updated.
Last update: 2025-04-26 09:29:17 UTC
README
Creates a firewall for using ApiKey application authentication for Symfony2.
This bundle is highly based on uecode/api-key-bundle
Installation
Requires composer, install as follows
composer require mkosiedowski/simple-api-key-bundle dev-master
Enable Bundle
Place in your AppKernel.php
to enable the bundle
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new mkosiedowski\SimpleApiKeyBundle\SimpleApiKeyBundle(), ); }
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 apiKey
in the query string.
simple_api_key: delivery: query #or header parameter_name: some_value # defaults to `api_key`
Applications repository
Applications are stored in applicationKeys table by default.
You should register Doctrine Entities mapping with your doctrine configuration:
doctrine: orm: entity_managers: default: mappings: SimpleApiKeyBundle: type: annotation dir: Entity is_bundle: true
Change security settings
You can now add simple_api_key: true
to any of your firewalls.
For Example:
security: firewalls: auth: pattern: ^/api/* simple_api_key: true stateless: true