// Get the key set from .../.well-known/jwks.json
const jwks = await getJWKS()
// Verify the signature and extract the token header and payload
const verifier = jose.createLocalJWKSet(jwks)
const { payload, protectedHeader } = await jose.jwtVerify(
token.token,
verifier,
{
issuer: 'https://app.skyfire.xyz',
...
}Claims to Verify
- In
kyatokens (typiskya+JWT)- Signature
algclaim isES256iatclaim is in the pastissclaim is set tohttps://app.skyfire.xyzjticlaim is set to a UUIDaudclaim is set to your Skyfire agent account IDsubclaim is set to a UUID- This is the buyer agent account ID
expclaim is now or in the futureverclaim is set to1envclaim isproduction- (
ssiclaim is set to your Skyfire seller service ID) OR (sdmclaim is set to your seller domain ANDsrlclaim is also set to your seller domain or a URL on your seller domain) - The
bidclaim contains the buyer principal's identity fields in a key-value map (JSONobject) - The
apdclaim contains the buyer agent platform's identity fields in a key-value map (JSONobject) - The
aidclaim contains the buyer agent's identity fields in a key-value map (JSONobject)
- In
paytokens (typispay+JWT)- Signature
algclaim isES256iatclaim is in the pastissclaim is set tohttps://app.skyfire.xyzjticlaim is set to a UUIDaudclaim is set to your Skyfire agent account IDsubclaim is set to a UUID- This is the buyer agent account ID
expclaim is now or in the futureverclaim is set to1envclaim isproduction- (
ssiclaim is set to your Skyfire seller service ID) OR (sdmclaim is set to your seller domain ANDsrlclaim is also set to your seller domain or a URL on your seller domain) valueclaim is> 0amountclaim is> 0curclaim is set toUSDstpclaim is one ofCOIN,CARDorBANKsticlaim contains the meta information for payment settlement depending on the settlement type (JSONobject)sprclaim matches the price that you configured in your seller servicespsclaim matches the pricing scheme that you configured in your seller service
- In
kya+paytokens (typiskya+pay+JWT)- Execute both
kyaandpaytoken validations as above
- Execute both
- NOTE: We recommend caching the
jwks.json (https://app.skyfire.xyz/.well-known/jwks.json)file for 60 minutes
