Replace the entire Featurebase authentication system with your own app’s login system.
Written By Bruno from Featurebase
Last updated 8 days ago
Overview
Single Sign-On allows you to replace our default authentication system with your own app's login system.
Users can log in using their existing account with your app, so they don’t have to worry about creating yet another account for Featurebase.
Benefits:
Seamless authentication & user experience for login
Restrict Featurebase access to private user groups (e.g. only paying customers, beta testers, etc.)
Works with widgets and the public portal for authentication.
Setting up SSO for the widgets
Here’s a quick rundown of what you need to do:
Generate a JWT by following the JWT Creation Guide. Store it on your server and make sure to not share it with anyone!
When a user wants to use the Featurebase widget, send a request to your server to generate a JWT.
On your server, generate a JWT with your customer data using the example below.
Finally, input this JWT value to any Featurebase widget as:
jwtToken:valueOfToken
Example:// implement generateJWT function to get jwt from your server const valueofToken = generateJWT() Featurebase("initialize_feedback_widget", { organization: "yourorg", // Replace this with your organization name // ...otherParams, jwtToken: valueofToken, });
If you run into any issues or have questions, please reach out to our support.
✅ All done! You’ve successfully implemented JWT authentication for widgets.
Setting up SSO for the public portal
This process involves setting up a dedicated page on your website to handle SSO authentication, creating and managing JWT tokens, and finally authenticating your users with Featurebase.
Here's a summary of the authentication flow:
Your user wishes to authenticate and clicks on the Login with YourCompany account button on your feedback board.
We redirect them to your website’s custom login page and append the return_to parameter to the URL.
https://yourwebsite.com/sso/featurebase?return_to=https://yourorg.featurebase.app/roadmap
Your authentication system logs the user into your website and creates a JWT token.
You return the user back to Featurebase with the generated token and the original return_to parameter passed along.
https://yourorg.featurebase.app/api/v1/auth/access/jwt?jwt=payload&return_to=https://yourorg.featurebase.app/roadmap
Featurebase logs the user in and automatically returns them back to where they started the authentication process.
1. Set up a dedicated SSO page
Set up a page on your website that will authenticate the user on your end (e.g https://yourdomain.com/sso/featurebase
)
Next, navigate to your Featurebase Dashboard → Settings → SSO, and enter the URL of the page you created in the SSO URL field. This is where Featurebase will redirect users who wish to log in through your app's account.
2. User authentication and JWT token creation
When a user arrives on your SSO page, authenticate them using your app's authentication system and create a JWT Token for them by following this guide.
3. Return the user back to Featurebase
Redirect the user to the Featurebase JWT endpoint with the JWT and return_to URL.https://yourorg.featurebase.app/api/v1/auth/access/jwt?jwt=payload&return_to=https://yourorg.featurebase.app/roadmap
If you run into any issues or have questions, please reach out to our support.
✅ All done! You’ve successfully implemented JWT authentication for the public portal.