List Your Token Policies

Endpoint URL: /{customerId}/config/tokenPolicies



Description

Returns information about the token policies associated with a customer.

Token policies are used to specify token lifetimes. By default, access tokens are valid for 1 hour (3600 seconds) before they expire; you can make the access token lifetime shorter than that value but not longer than one hour. Refresh tokens are valid for 90 days (7776000 seconds), but that lifespan can either be shortened, or can be extended to as long as one year.

Token policies are also used to specify the allowed scopes for clients associated with a given policy.


Respects the API Client Allow List: No


Authentication

This endpoint requires token-based authentication. To obtain an access token, you must use a confidential client (using the client ID as the username and the client secret as the password) to access the /{customerId}}/login/token endpoint. The access token returned from the token endpoint is then used in the Authorization header of your API call. For example, if you get back the access token Ki712dpGq5GPQcsxMHY6ShHY7wU_iTs0o9dPx4TEzf5yLIvddjnDVBJxjPDucf5YVB then your Authorization header would look like this when using Curl:

-H 'Authorization: Bearer Ki712dpGq5GPQcsxMHY6ShHY7wU_iTs0o9dPx4TEzf5yLIvddjnDVBJxjPDucf5YVB'

In Postman, set the Authorization Type to Bearer and use the access token as the value of the Token field.


Path Parameters

Path parameters that must be included in the request are listed in the following table:

NameTypeRequiredDescription

{customerId}

string

Yes

Unique identifier of the customer associated with the token policies.


Sample Request (Curl)

The following command returns information about the token policies associated with the customer 01000000-0000-3000-9000-000000000000:

curl -X GET \
  https://v1.api.us.janrain.com/01000000-0000-3000-9000-000000000000/config/tokenPolicies \
  -H 'Authorization: Bearer Ki712dpGq5GPQcsxMHY6ShHY7wU_iTs0o9dPx4TEzf5yLIvddjnDVBJxjPDucf5YVB' 


Responses

200 OK

If your call to this endpoint succeeds, you'll get back information about all the token policies associated with the specified customer:

{
    "total": 4,
    "_embedded": {
        "tokenPolicies": [
            {
                "id": "598a1f6a-26dc-47c0-8f72-231e39ba36a7",
                "_links": {
                    "self": {
                        "href": "/01000000-0000-3000-9000-000000000000/config/tokenPolicies/598a1f6a-26dc-47c0-8f72-231e39ba36a7"
                    }
                }
            },
            {
                "id": "5b6885e2-6d56-4067-9a4b-3a90238d6b8a",
                "_links": {
                    "self": {
                        "href": "/01000000-0000-3000-9000-000000000000/config/tokenPolicies/5b6885e2-6d56-4067-9a4b-3a90238d6b8a"
                    }
                }
            },
            {
                "id": "aee360f7-6a3c-4961-9520-3db283fd974b",
                "_links": {
                    "self": {
                        "href": "/01000000-0000-3000-9000-000000000000/config/tokenPolicies/aee360f7-6a3c-4961-9520-3db283fd974b"
                    }
                }
            },
            {
                "id": "d0009d7e-df77-42ce-b744-80309c376886",
                "_links": {
                    "self": {
                        "href": "/01000000-0000-3000-9000-000000000000/config/tokenPolicies/d0009d7e-df77-42ce-b744-80309c376886"
                    }
                }
            }
        ]
    }
}