-
Notifications
You must be signed in to change notification settings - Fork 5
LoginEmailPassword
Walter Lara edited this page Feb 16, 2024
·
3 revisions
Allows login using email and password. On success, provides a JWT access token that can be used to access protected resources and a refresh token.
URL: /v1/auth/login
Method: POST
Path Parameters: None
Query Parameters: None
Headers:
Content-Type: application/json
Accept: application/json
g-recaptcha-platform: {Web|Android|iOS}
g-recaptcha-token: {reCAPTCHA Token for "login" acion}
Content:
Field | Type | Description | Requirement Type |
---|---|---|---|
string | Valid email address. | Required | |
password | string | Password in plaintext. | Required |
Content example:
{
"email": "[email protected]",
"password": "abcd1234"
}
Code: 200 OK
Headers:
Content-Type: application/json
Content:
Field | Type | Description | Condition |
---|---|---|---|
accessToken | string | JWT token usable to access protected resources. | Always |
refreshToken | string | JWT token usable one-time only to refresh an expired accessToken . |
Always |
Content example:
{
"accessToken": "93144b288eb1fdccbe46d6fc0f241a51766ecd3d",
"refreshToken": "6d6fc0f241a51766ecd3d93144b288eb1fdccbe4"
}
Code: 404 NOT FOUND
Condition: If no registered user with 'email' is found
Headers:
Content-Type: application/json
Content example:
{
"code": 404,
"description": "Not Found",
"cause": "Doesn't exist: [email protected]"
}
Code: 401 UNAUTHORIZED
Condition: If 'password' is invalid.
Headers:
Content-Type: application/json
Content example:
{
"code": 401,
"description": "Unauthorized",
"cause": "Invalid password"
}