Each unique buyer agent that seeks to buy from your seller service, will provide a KYAPay token to your seller service. This token will identify the buyer uniquely. The buyer agent's unique ID will be in the sub
claim and the buying human's identity will be in the bid
claim.
On your (seller's) end, you have the option to follow one of three typical paths from least effort to most effort (and also most secure).
-
Require the agent to provide a
kya
token with each request typically in anHTTP header
(we recommend naming the headerskyfire-pay-id
for consistency)- In this case, your service can use the
kya
token itself to authorize the agent's access and optionally create an account for the agent - When the agent wants to make a purchase, your service would require a
kya+pay
token to be provided (also typically in the header of the purchase request)
- In this case, your service can use the
-
Add a
/create-acount-and-or-login
endpoint- In this case, this endpoint will require the agent to provide a
kya
token, typically in theHTTP header
of the request - Your service will validate and extract the buyer's identity from the token and can then either create the agent's account and log the agent in or if the account already exists, then just log the agent in
- In this case, your service would typically return an
Access token
orSession token
to the agent for it to use in future requests - When the agent wants to make a purchase, your service would require a
pay
token to be provided (also typically in the header of the purchase request)
- In this case, this endpoint will require the agent to provide a
-
Add a
/create-acount-and-or-login
endpoint and require a password- This is an extension of 2 (above)
- In this case, this endpoint will require the agent to provide a
kya
token, typically in theHTTP header
of the request - Additionally this endpoint will require the agent to pass a
password
in thebody
of the request - Your service will validate and extract the buyer's email address from the token (
bid.skyfireEmail
) and thepassword
from the request body - Your service will then use your CIAM's APIs to create an account and / or login the agent using the
email address
andpassword
- This is typically a straightforward token exchange process and we can walk you through how to do this with your CIAM
- This approach exchanges a
kya
token for anaccess
token in the CIAM
- The agent is expected to know whether it already has an account, and if so, to provide the correct
password
to login instead of creating an account - In this integration the human principal, behind the agent, gains the ability to also login to your service
We recommend requiring Skyfire / KYAPay tokens to be passed to your service via an HTTP Header
named skyfire-pay-id
. You are welcome to use any other header
or body
parameter as well. We recommend NOT using the Authorization
header to avoid conflicting with existing functionality that may already use that header.
Other paths may be possible and we are happy to discuss and support you in meeting your needs.