Configuring JWT-based authentication with Crossmint
private_key_base64.txt
file from your system.Claim | Type | Required | Content |
---|---|---|---|
iss | string | yes | Your Crossmint project ID |
sub | string | yes | Unique identifier for this user. Use the same userId you use elsewhere when identifying this user in Crossmint APIs |
aud | string | array (string) | yes | ”crossmint.com” |
exp | int (unix timestamp in seconds) | no | The expiration time (unix seconds). Set it at a minimum to around 10m after it was issued. |
nbp | int (unix timestamp in seconds) | no | Not Before time (unix seconds). Tokens with this claim are valid from that moment forward. |
iat | int (unix timestamp in seconds) | no | The time in which the token was emitted. |
Config | Options supported | Recommended |
---|---|---|
Encoding | base64 | base64 |
JWS signing algorithm | RS256 | RS256 |
Encryption | none | none |
npm install jose
.
jose
.
getOrCreateWallet()
in the Smart Wallet SDK, which takes the JWT as an input.