Single Sign-On (SSO) is an identification method that allows users to access multiple applications and websites with just one set of login credentials.
EchoRivo’s Single Sign-On (SSO) feature streamlines the process of user identification, allowing your customers to upvote, comment, or create a feature request without needing to go through additional email verification steps.
By integrating SSO, EchoRivo communicates with your server to determine if a user is already registered, and if so, automatically identifies them.
The tutorial will show how to execute the SSO method with EchoRivo.
Steps to implement the SSO method with EchoRivo #
Provide a URL for EchoRivo to redirect users to, where they can either log in or sign up. If the user is already logged in, simply redirect them back to the provided redirect URL as can be seen from point 2.
EchoRivo will send a request to your provided URL, appending a `redirectUrl` parameter.
For example, if your URL is `https://example.com/sso`, EchoRivo will call `https://example.com/sso?redirectUrl=https://app.EchoRivo.ai/backend/api/v1/sso/fallback/productSlug/`.
To implement SSO, you’ll need to:
Create a JSON Web Token (JWT) containing the user’s `email` and `name`.
Sign the JWT with EchoRivo’s provided `SSO Token` to ensure the request originates from your server.
Make an HTTP GET request to the `redirectUrl` with the created token attached.
An example of the request can be found below:
HTTP GET
https://app.EchoRivo.ai/backend/api/v1/sso/fallback/productSlug/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
EchoRivo will validate the request, and if everything checks out, the user will be granted access to upvote, comment, or create a feature request without any need to login to the EchoRivo system again.
Below you can find a code example for Node.js:
import jwt from 'jsonwebtoken';
const EchoRivoSSOToken = 'EchoRivoSSOToken'; // From Products -> SSO -> SSO Token
const user = {
email: '[email protected]',
name: 'Joe Doe',
};
const generatedJwtToken = jwt.sign(user, EchoRivoSSOToken, { algorithm: 'HS256' });
For other programming languages, you can use an equivalent JWT library to create and sign the token with EchoRivo’s SSO Token.
Here are some examples of popular languages:
Python #
import jwt;
EchoRivo_sso_token = 'EchoRivoSSOToken' # From Products -> SSO -> SSO Token
user = {
'email': '[email protected]',
'name': 'Joe Doe',
}
generated_jwt_token = jwt.encode(user, EchoRivo_sso_token, algorithm='HS256')
Ruby #
require 'jwt'
EchoRivo_sso_token = 'EchoRivoSSOToken' # From Products -> SSO -> SSO Token
user = {
'email': '[email protected]',
'name': 'Joe Doe',
}
generated_jwt_token = JWT.encode(user, EchoRivo_sso_token, 'HS256')
PHP #
<?php
require 'vendor/autoload.php';
use \Firebase\JWT\JWT;
$EchoRivo_sso_token = 'EchoRivoSSOToken'; // From Products -> SSO -> SSO Token
$user = [
'email' => '[email protected]',
'name' => 'Joe Doe',
];
$generated_jwt_token = JWT::encode($user, $EchoRivo_sso_token, 'HS256');
By following these examples, you can implement EchoRivo’s SSO feature in your preferred programming language. Once the JWT token is generated, signed, and sent to the `redirectUrl` provided by EchoRivo, your users will be able to seamlessly interact with your platform, making it easier for them to upvote, comment, and submit feature requests.
That’s it! Those were the steps on how to manage EchoRivo’s SSO feature.