Single Sign-On (SSO)

What is Single Sign-On

If you have accounts of your users in your system - you can effectively provide this data using a JSON Web Token generated on your server to authenticate users on your public roadmap. This mechanism is called Single Sign-On.

How to generate a token

Here are the instructions on how to generate and use a token for signing in users automatically on your public roadmap or in your widgets

Get required parameters from your ProdCamp account

  • Login to your ProdCamp account (you must be an account administrator)

  • Go to the Settings page and then to the Workspace tab

  • On the Workspace tab, there are two important things that you will need to generate a token: Workspace Id and Secret key. You will need it a bit later in this article.

Install library

First, you need to install a specific library for working with JWT tokens

npm install --save jsonwebtoken

Generate the token

Copy and insert the Secret key from the Workspace tab to the SecretKey variable in the snippet. Fill in the user data by providing user email, first name, last name, etc., and the Workspace Id. Then encode this data using the secret key like it's shown below:

var jwt = require('jsonwebtoken');

var SecretKey = 'your_secret_key';

function createToken() {
  var userData = {
    avatarUrl: 'user_avatar_url',
    email: '' // required
    firstName: 'John',
    lastName: 'Doe',
    company: JSON.stringify({
      name: 'Foo Company',
      revenue: 1000
    workspace_id: '01234567-1c34-1b34-1234-cecb45ab891f' // required
  return jwt.sign(userData, SecretKey, {algorithm: 'HS256'});

var token = createToken();

How to use the token to authenticate public roadmap users

After that, you can use the generated token inside the query parameter of a public roadmap URL like{generated_token} and provide this link somewhere inside your app to quickly redirect your users to your public roadmap page where they will be automatically authenticated and will have the ability to leave feedback right away.

You can also use this token to secure your widgets from any unauthorized access. Learn more here.

Last updated