-
Notifications
You must be signed in to change notification settings - Fork 0
Authentication
Allan Batista edited this page Jun 26, 2019
·
1 revision
Authentication is required to perform anything with API. If not authenticated correct, expired or other thing. Is expected to receive 401 or 403.
Current authentication workflow, supports only Google OAuth.
To sign in
GET /auth/session/google_sign_in
If authentication Works fine It will be redirect to DEEP_THOUGHT__AUTH__CALLBACK_ENDPOINT with jwt as param.
GET /?jwt=XXXX
If authentication not works well. It will be redirect to DEEP_THOUGHT__AUTH__CALLBACK_ENDPOINT with message and error code as param.
GET /?error_code=123&message=This is example message
JWT should be save on local storage and should be used every request in header Authentication.
To check is authentication work fine. Just do a request as bellow.
GET /user
Authentication: XXXX
status: 200
{
"id": "xxx",
"name": "xxx",
"email": "asasda",
"picture": "https://...",
"verified_email": true,
"created_at": "2019-06-22T22:31:11+00:00",
"updated_at": "2019-06-22T22:31:12+00:00"
}