If it is first party client, it is seamless to login using the built in web client proxy at ...v1/clients/web/login
. Using a proxy is actually preferred since your oauth keys won't be exposed to the app.
Assuming you have passport installed and have run all database migrations, you can do the following.
First, if not yet done, create a passport client by php artisan passport:install
Add your keys to your .env
file
CLIENT_WEB_ID={id-here}
CLIENT_WEB_SECRET={secret-key-here}
Update your config cache so new envs above are picked up by running php artisan config:cache
.
Create a user.
verification_url
is required if you have enabled registration email verification require_email_verification=> true
. This url is the same as your .env
APP_URL
.
POST: {{api-endpoint}}/v1/register
Headers: Accept: application/json
Body
{
"name": "First Last",
"gender": "male",
"birth": "2015-10-15",
"email": "email@email.com",
"password": "Password1!",
"verification_url": "http://{your-domain}/email/verify"
}
- After a successful verification. You can now login via the built-in web-client proxy.
POST: {{api-endpoint}}/v1/clients/web/login
Headers: Accept: application/json
Body
{
"email": "email@email.com",
"password": "Password1!"
}