Download the PHP package grzegorz-jamroz/sf-doctrine-api-auth-bundle without Composer
On this page you can find all versions of the php package grzegorz-jamroz/sf-doctrine-api-auth-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download grzegorz-jamroz/sf-doctrine-api-auth-bundle
More information about grzegorz-jamroz/sf-doctrine-api-auth-bundle
Files in grzegorz-jamroz/sf-doctrine-api-auth-bundle
Package sf-doctrine-api-auth-bundle
Short Description Bundle provides authorization for Symfony Doctrine Api bundle
License
Informations about the package sf-doctrine-api-auth-bundle
Ifrost Doctrine Api Auth Bundle for Symfony
Bundle provides authorization for Symfony Doctrine Api bundle with JWT and Refresh Token
Installation
-
Update routing configuration in your project:
- Configure Doctrine to store UUIDs as binary strings
Note: It is possible to configure Doctrine to store UUIDs in different way - you can read about it here. Please note that bundle will work only with UUIDs stored as binary types.
- Create User entity which implements ApiUserInterface
example:
- Create Token entity with implements TokenInterface
example:
-
Create
config/packages/ifrost_doctrine_api_auth.yaml
file and add: -
Generate the SSL keys source
- Update security configuration source
example:
- Important note for Apache users
Apache server will strip any Authorization header not in a valid HTTP BASIC AUTH format. Read more here To solve this problem add those rules to your VirtualHost configuration:
-
Configure your Symfony App Databse source
-
configure the Database in your
.env
file -
create database if not exist yet
-
install symfony/orm-pack and symfony/maker-bundle if not installed
-
create migration
- run migration
-
-
Clear cache:
- Now you can debug your routes. Run command:
you should get output:
-
Create UserController
- Now you can debug your routes. Run command:
you should get output:
-
Temporary set route
users_create
available to the public to make test user: -
Make test user:
- Revert
config/packages/security.yaml
to state before point 12:
Usage
Login / Get token
example response (if enabled return_refresh_token_in_body config parameter):
Get Refresh Token
or if config parameter cookie enabled:
example response:
Configuration
You can find default configuration here.
All versions of sf-doctrine-api-auth-bundle with dependencies
lexik/jwt-authentication-bundle Version ^2.16