Skip to content

LoginEmailPassword

Walter Lara edited this page Feb 16, 2024 · 3 revisions

Login using Email/Password

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.

Request

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
email string Valid email address. Required
password string Password in plaintext. Required

Content example:

{
    "email": "[email protected]",
    "password": "abcd1234"
}

✅ Success Response

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"
}

❌ Error Responses

1. Not Found

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]"
}

2. Unauthorized

Code: 401 UNAUTHORIZED

Condition: If 'password' is invalid.

Headers:

Content-Type: application/json

Content example:

{
    "code": 401,
    "description": "Unauthorized",
    "cause": "Invalid password"
}

See Also

Login using OAuth

Refresh JWT Access Token

Decode JWT Access Token

Request 2FA Code

Clone this wiki locally