Authentication
The JFW API uses Auth Keys to authenticate Protocol requests. You can obtain an Auth Key by either using the JFW libraries or calling the following API endpoint:
After a successful authentication, the following headers must be included to register or update the user’s device:
- X-Device-Code: A unique identifier for the device.
- X-Device-Token: The Firebase device token used for push notifications.
- X-Device-Name: The name/model of the device.
- X-App-Version-Number: The version of the application.
- X-Os-Device: The operating system of the device (iOS, Android).
The brand URL of the request. This is used to identify the brand.
YOUR_BRAND_URL
This is the model class for UserAuthentication.
This represents the username of the user.
john.doe
This represents the password of the user.
password
POST /api/v1/users/auth HTTP/1.1
Host: protocol.jframework.io
Brand-URL: text
Content-Type: application/json
Accept: */*
Content-Length: 45
{
"username": "john.doe",
"password": "password"
}
{
"success": true,
"statusCode": 200,
"message": "The request was successful.",
"data": {
"id": "asdasdcwAqrNxIT0xQdkMvR",
"username": "user",
"emailAddress": "[email protected]",
"authKey": "8mgBXMwMchIWWlLmvEL9RasdasdcwAqrNxIT0xQdkMvRndmSjh4YmtOcjdZb2taUT09N1J5bVdzRDlUUWhhRFFwdlRhemk4ZDFuaFdHajYzVXlYLy9valkwYXpuQT0=",
"expiresIn": "0001-01-01T00:00:00"
},
"errors": []
}
After having the Auth Key, you have to put that Auth Key and Brand URL to your HTTP request header to use other API endpoints.
Brand-URL: your-domain.com
Auth-Key: your-key-is-here
Instead of an API key, we use a combination of Brand-URL and Auth-Key to gain access to API endpoints. To access those API endpoints that need certain permissions, we must include Auth-Key, brandUrl, or both in the request body. These values may not match the ones in the request headers.
If you need to use the device access, add the key header Device-Code before using the device access feature.
Last updated
Was this helpful?