Folder Access Token

Intended use is to provide a single sign-on flow between the My Azur mobile app (Android/iOS) and each My Azur Business website.

Folder Access Tokens are issued per folder and grant a scope that allow the token holder (My Azur Business Website) to get the user identity info from My Azur API.

To create a a folder access token use the endpoint {{api_base_url}}/folders/<folder_id>/access-tokens.

Example:

curl  --request POST --location 'http://{{api_base_url}}/folders/1/access-tokens' \
      --header 'Authorization: Bearer <User Firebase Token>
{
    "created_at": "2023-08-22T09:44:21.825464",
    "created_by": "XyWjp31BVWOTUazhK5VNKusI3lv1",
    "expire_at": "2023-08-22T09:45:21.831666",
    "id": 22,
    "updated_at": "2023-08-22T09:44:21.825464",
    "updated_by": "XyWjp31BVWOTUazhK5VNKusI3lv1",
    "value": "RsVmuekCrRM3PVLGJxRxXFDmw6HSLwi5XjLUSBo3pDh7624Q"
}

To validate a folder access token pass the value of the Folder Access Token into the Authorization Header using the new endpoint {{api_base_url}}/folders/<folder_id>/users/me

Example:

curl  --location 'http://{{api_base_url}}/folders/1/users/me' \
      --header 'Authorization: Bearer RsVmuekCrRM3PVLGJxRxXFDmw6HSLwi5XjLUSBo3pDh7624Q

Response:

{
    "code": "XyWjp31BVWOTUdsfhK5VNKusI3lv1",
    "created_at": "2022-02-16T16:40:13.404897",
    "created_by": "XyWjp31BVWOTUdsfhK5VNKusI3lv1",
    "email": "[email protected]",
    "firstname": "John",
    "id": 15,
    "surname": "Doe",
    "updated_at": "2022-02-16T16:40:13.404897",
    "updated_by": "XyWjp31BVWOTUdsfhK5VNKusI3lv1"
}

The endpoint returns the basic user info of the user who originally created the folder access token.

By default access token expires after 3 minutes.

Last updated