Authentication Endpoint
You will need to implement an Authentication API. When the UX Toolkit is bootstrapped on your webpage it will need to be passed the URL of this endpoint as a parameter. The Toolkit SDK will generate a Demonstrating Proof of Posession (DPoP) header as a short-lived JSON Web Token (JWT) and pass it to your endpoint.- This endpoint must validate that the end user is authenticated in your systems
- Lookup the Treasury Prime card ID for the end user you want a token for (e.g.
card_1234567) - Send a request to the Treasury Prime
/card/{id}/uxt_access_tokenendpoint (documented below)
UX Toolkit Bootstrapping
Follow Marqeta’s instructions on embedding and bootstrapping here. Embedding the Toolkit in your webpage is as simple as adding:tprime.
Treasury Prime Endpoint
Treasury Prime will manage the RSA key generation and secret passing on your behalf within the/card/{id}/uxt_access_token endpoint.
The endpoint must receive the DPoP header Marqeta passed you via your Authentication Endpoint as a string parameter.
On a successful authentication Treasury Prime will send back a response containing an access_token that must be sent back to the UX Toolkit client.
See the API endpoint documentation for an OpenAPI schema.
The person-scoped
/person/{id}/uxt_access_token endpoint is deprecated. Use the card-scoped /card/{id}/uxt_access_token endpoint instead.Getting the card token
UX Toolkit components require acard-token parameter to identify which card to display. Use the external_id field returned by the Treasury Prime List Cards (GET /card) and Fetch a Card (GET /card/{id}) endpoints as the card-token value.
external_id value as card-token when initializing UX Toolkit components.