Articles on: Developers

Single Sign On (SSO)

SSO allows login your users automatically in your Portal, without requiring a login or password.



Therefore when users react to or comment on your posts in the newsfeed, they are identified too, like as works in the in-app widget.

SSO Secret Token


To enable SSO, the first step is to get your SSO Token from the Settings section.

Your token is secret and should never be shared with unauthorized people, or on your front-end for example.



Generate tokens on your server



Let's use PHP as example.

Install php-jwt in your project
composer require firebase/php-jwt


Generate JWT
<?php
use \Firebase\JWT\JWT;

$userData = [
    'id' => "123456",
    'name' => "Paulo Castellano",
    'email' => "paulo@changelogfy.com"
];

$GENERATED_SSO_TOKEN = JWT::encode($userData, 'SSO_SECRET_TOKEN', 'HS256');


In your In-App widget code, you need pass param sso to widget.
<script>
    var CLF_config = {
        selector: ".changelogfy-widget",
        app_id: "YOUR_APP_ID",
        sso: "GENERATED_SSO_TOKEN"
    };
</script>
<script async src="https://widget.changelogfy.com/index.js"></script>


If all works fine, your users will be automatically logged in to your public or private portal.

If you still have questions, please contact us by chat.

Updated on: 03/30/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!