Token SSO setup guide

  • 19 May 2020
  • 4 replies

Userlevel 6
Badge +1
  • Product Guru
  • 26 replies posted

What is Token SSO?

Token is a JWT-based authentication mechanism that provides simple and secure way to integrate any Service (Identity Provider) with Community (Service Provider)

Token SSO Flow Representation

In order to understand how the Token SSO process integrates into the overall Community SSO architecture (i.e. Steps #1-3 in the diagram below) please see Single Sign-on (SSO): Getting Started.


  1. Community redirects User to the Login URL with GET 

  2. Server authenticates the User and obtains consent/authorization.

  3. Server fetches user Profile data

  4. Server generates Token and sends it to Return URL with GET 

  5. Community receives Token, decodes and validates it by using Public Key and extracts Profile data

After retrieving the Profile dataCommunity starts #Step 3 of Community Single Sign-on.


How to Configure Token SSO on inSided


Server and Token generation

  • Generate pair of keys for Token signing (requires shell and openssl).
  • Check out the example below:



openssl genrsa -out jwtRS256.key 2048
openssl rsa -in jwtRS256.key -pubout -outform PEM -out

Set up a web Server with Login Endpoint that performs the following:

  1. Authenticate and authorize User.

  2. Fetch Profile data.

  3. Generate a signed Token (supported algorithms: RS256, RS384, RS512, ES256, ES384, ES512, HS256, HS384, HS512).

  4. Send the Request with GET by using Return URL in this format:

    1. If your instance is based in the EU:[TOKEN]&customer=[customer-en]

    2. If your instance is based in the US:[TOKEN]&customer=[customer-en]

    3. If your instance is staging:[TOKEN]&customer=[customer-en-staging]


  • We recommend to use asymmetric algorithm, e.g. RSA256. Check out the example at the bottom of the article (token.php).
  • Here’s a useful resource that makes life easier when you work with JWT


Note: JWE (Encryption) is not supported on inSided.


Community (inSided) configuration

  1. Log in to Control as an Administrator
  2. Go to Integrations > SSO > Token
  3. Fill in the following required fields:
    • Login URL: Login Endpoint URL
    • Public Key: Public key part from the previously generated pair of keys
  4. Press Install.

Once you’ve installed your configuration, we recommend using the built-in inSided SSO testing tool before you enable SSO for end users, to make sure everything is working as expected.



//please install the package first
use Firebase\JWT\JWT;

//Read previously generated pair of keys
$privateKey = file_get_contents('jwtRS256.key');
//public key will be also needed as Public Key later in the Control Token configuration page
$publicKey = file_get_contents('');

$payload = array(
'id' => 'VGqczRfTVaSm',
"username" => "john.doe",
'email' => '',
"avatar" => "",
"customRoles" => "12,13"

//Get token by signing it with private key
$token = JWT::encode($payload, $privateKey, 'RS256');
echo "Token: $token" . PHP_EOL;

//Decode it back for demo purposes
$payload = (array)JWT::decode($token, $publicKey, array('RS256'));
echo "Decoded payload: " . json_encode($payload) . PHP_EOL;


4 replies

A question — how do I update the button to say something other than “Login with Token” ? Having a hard time finding it in Phrases.





Userlevel 4
Badge +1

Hi @MackenzieK! The phrase for “Login with Token” is not in the list of default phrases in Control, but it can be added using the following:

Module.               Key.



Userlevel 5
Badge +1

@Cristina do you have the phrases for the rest of the copy on that popup?

  • Login to the community
  • Social login


Userlevel 4
Badge +1

Hi @Michael_S! Sure, here they are:  

  • Login to the community: 



  • Social login