Issuing a Token

How to request a LiSTNR JWT from the token provider.


Endpoint

POST /v1/listnr-token-provider/issue-token
Content-Type: application/json
EnvironmentURL
Devhttps://australia-southeast1-pcone-xl-fb-dev.cloudfunctions.net/listnr-token-provider/v1/listnr-token-provider/issue-token
Productionhttps://australia-southeast1-pcone-xl-fb-prod.cloudfunctions.net/listnr-token-provider/v1/listnr-token-provider/issue-token

Authentication

How you authenticate depends on the integration pattern you were onboarded with.

Authenticated User Bearer

Include the signed-in user's ID token as a Bearer credential. The subject of the issued token is taken from the verified token — you do not supply it.

POST /v1/listnr-token-provider/issue-token
Authorization: Bearer <token>
Content-Type: application/json

{
  "client_id": "<your-client-id>",
  "scope": "<your-scope>"
}

Client Credentials (Basic Auth)

Encode your client_id and client_secret as HTTP Basic credentials. Supply the subject field in the request body — this is the stable identifier for the user or entity the token represents.

POST /v1/listnr-token-provider/issue-token
Authorization: Basic <base64(client_id:client_secret)>
Content-Type: application/json

{
  "client_id": "<your-client-id>",
  "subject": "<subject-identifier>",
  "scope": "<your-scope>"
}

The client_id in the request body must match the one encoded in the Authorization header.


Request body

FieldRequiredDescription
client_idyesYour assigned client identifier.
scopenoSpace-separated list of scopes to request. Must be a subset of the scopes assigned to your client during onboarding. Omit to receive a plain identity token with no scope claims.
subjectClient Credentials onlyA stable identifier for the user or entity the token represents. Not used for authenticated user bearer tokens — the subject is extracted from the token.

Response

200 OK

{
  "access_token": "<signed-jwt>",
  "token_type": "Bearer",
  "expires_in": 900
}
FieldDescription
access_tokenThe signed JWT. Pass this as Authorization: Bearer <access_token> on requests to services that accept LiSTNR tokens.
token_typeAlways "Bearer".
expires_inSeconds until the token expires. Tokens are valid for 15 minutes (900 seconds).

Store the token in memory. Re-request a fresh token before expiry — there is no refresh mechanism. Proactively re-issue approximately 2 minutes before the token expires.


Error responses

Errors follow the OAuth 2.0 error shape:

{
  "error": "<error-code>",
  "error_description": "<human-readable description>"
}
HTTP statuserrorCommon cause
400invalid_requestMalformed request body or missing required field
400invalid_scopeRequested scope is not permitted for your client
401invalid_clientInvalid or expired credentials (authenticated user token or client secret)
403unauthorized_clientClient exists but is disabled

Token lifetime

PropertyValue
Lifetime15 minutes
RefreshNot supported — re-call the issue endpoint with fresh credentials
Authenticated user token lifetime1 hour