Authentication & Tokens
The Authentication API allows you to authenticate users on your end and redirect them as authenticated users back to vivenu. After successful login on your end, you should issue an exchange token and redirect the user back to the appropriate page.
Endpoints
Create an exchange token
After issuing an exchange token, you should redirect the user back to the vivenu to be logged in.
The url the user should be redirected to can be created as follows.
Append the recently created token as exchangeToken
query parameter to the redirect_uri
.
Notice: redirect_uri
is a query param that we provide when we request a login.
Payload
The type of the resource to create an exchange token for
customer
The id of the customer to create an exchange token for
{"resourceType": "customer","customerId": "string"}
{"exchangeToken": "string","expiresIn": 900}
Exchange a token
In order to receive an access token, you need to provide the created exchange token to this endpoint. This might be useful if you need to access authenticated customer APIs in order to create your own account experiences.
Payload
The token to be exchanged for an access token
{"exchangeToken": "string"}
{"token": "string","expiresIn": 3600}
Returning to vivenu
Notice: You do not need to know the details of this endpoint when you redirect the user back to vivenu using the redirect_uri
parameter, as described in the section above.
In case you do not have a redirect_uri
, for example when initiating the authentication process yourself (redirecting a user from your page to vivenu), this is the endpoint you should redirect the user to.
The redirect_uri
you need to provide for this endpoint will be the url the user should be redirected on when the authentication process is complete. This could be the url of your seller page, for example.
Query
The exchange token that was issued to you by vivenu.
The url to which you want to redirect the user after he is signed in.