How it works
When a user clicks a link on the Marketplace or your Integration, we will append a parameter to the URL containing a JWT (JSON Web Token). This token can then be used on the gated store to check if the user is verified to see the discounts.This token is signed by us, which means:- It cannot be tampered with
- It is valid for 5 minutes, meaning it cannot be shared around
- It contains information about the user so that we can check they are verified with Student Beans
Steps to set up
- Create a page with discounted products that you want verified users to get access to
- Block access to this page (directions below)
- Give your Pion contact the URL of the gated page
- Pion will set up your gated discount with the URL you provided
How to gate your page
- We will navigate users to the page that is created with a query string parameter (token) named
t, this parameter will contain a JWT. For example, in this URL below…
https://educationstore.com/shop?t=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the JWT. It’s everything that appears after the ‘t=’
- You’ll need to extract the token from the query string.
- Use this token to send a request back to Student Beans so we can validate it. Below is an example
curlrequest:
- You will then receive one of two responses from us, both with status code 200.
- Decode the JWT
- Redirect the user to the
return_urlfield