The Fifth World

Authenticate

Obtain a JSON Web Token to authenticate with the API (see Authentication). You can use this endpoint to authenticate with an email and passphrase combination by providing email and pass parameters in the body, or by matching a stored OAuth 2.0 token by providing provider and id parameters in the body. If we can authenticate the parameters provided, the endpoint returns a JSON Web Token which can authenticate you to other API endpoints for the next 15 minutes.

Request

Body Parameters
Request body data Value type Value
email string If provided along with pass, tries to authenticate by email and passphrase.
pass string If provided along with email, tries to authenticate by email and passphrase.
provider string If provided along with id, tries to authenticate by OAuth 2.0 token.
id string If provided along with provider, tries to authenticate by OAuth 2.0 token.

Examples

Example Request
POST /v1/members/auth HTTP/1.1 Host: api.thefifthworld.com email=you@example.com pass=I use a long, memorable passphrase.
Example Request
POST /v1/members/auth HTTP/1.1 Host: api.thefifthworld.com provider=facebook id=1234567890

Response

If the API can authenticate your credentials, you receive a 200 HTTP status along with a plain text response, providing your JSON Web Token. This encrypted string includes data about your session and will remain valid for the next 15 minutes. With this token, you can use the renew authentication endpoint to get a new token, keeping your session over periods much longer than 15 minutes. If the API cannot authenticate you, it responds with a 401 HTTP status.

Example

Example Response
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c