If your customers already have user accounts in your application, you can allow them to log in to your feedback widget using our Single Sign-On (SSO) mechanism.
The Single Sign-On is based on a security mechanism that allows Sleekplan to trust the login requests received from your server. Sleekplan only grants access to users who have been authenticated by you. Sleekplan-SSO uses JSON Web Token (JWT), a technology for the secure exchange of user authentication data.
Single sign-on in 3 steps
1. Get your SSO secret key
To create a JSON Web Token (JWT), you need the private key for your product. You can find this key by navigating to Settings > Developer and grabbing your SSO Key.
2. Generate a token on your server
In the next step, you need to generate a JSON Web Token on your server. Create a JWT with the HS256 algorithm and pass your SSO secret key as a Key parameter. Check out our developer documentation for more help.
3. Set the token on page load
In the snippet below, replace the example token (XXXXX) in the window.SLEEK_USER object with your own variable for user token.
<!-- User Token -->
<script type="text/javascript">
window.SLEEK_USER = {
token: 'XXXXXXX'
}
</script>
<!-- Sleekplan Widget Code -->
<script type="text/javascript">window.$sleek=[];window.SLEEK_PRODUCT_ID=XY;(function(){d=document;s=d.createElement("script");...</script>