Skip to content
/ auth Public

Open Auth Centralized Login and Authentication Module

License

Notifications You must be signed in to change notification settings

AnimeNL/auth

Repository files navigation

AnimeCon Authentication

Pre-requisites:

  • ^7.3
  • Anplan database

Generate certificates

mkdir -p var/oauth
openssl genrsa -passout pass:<PASSWORD> -out var/oauth/private.key 2048
openssl rsa -in var/oauth/private.key -passin pass:<PASSWORD> -pubout -out var/oauth/public.key
composer install

Update configuration

Copy .env to .env.local and update to the values for your environment

Create the database

php bin/console doctrine:database:create --if-not-exists
php bin/console doctrine:schema:update --force 

Create a client

php bin/console trikoder:oauth2:create-client --grant-type=password --grant-type=refresh_token --scope=cms --scope=events --redirect-uri=https://example.com

Use the information shown in this command (or list-clients) in your authentication call.

Get a token

curl --location --request POST 'http://127.0.0.1:8001/token' \
--header 'Content-Type: application/json' \
--form 'grant_type=password' \
--form 'client_id=~' \
--form 'client_secret=~' \
--form 'username=~' \
--form 'password=~'