/fake_auth

Symfony Security で保護されたAPIを、HTTPクライアントでデバッグしやすくする

Primary LanguagePHP

iamyukihiro/fake_auth

Enviroment

$ docker -v
Docker version 25.0.3, build 4debf41

Installation

$ cp .env .env.local
$ bin/dev/compose
$ bin/dev/open

Change the OAuth

# .env.local

APP_ENV=prod # Google OAuth
APP_ENV=dev  # Fake OAuth

Execute the API

OK

# APP_ENV=dev

$ curl 'https://127.0.0.1:8000/api/chart' \
-H 'username: test@example.com'

NG

Unauthorized

# APP_ENV=dev

$ curl 'https://127.0.0.1:8000/api/chart'
# APP_ENV=prod

$ curl 'https://127.0.0.1:8000/api/chart' \
-H 'username: test@example.com'