How to Integrate Open SSO
Open SSO can be use for your external user management or simply just use Open SSO for authenticate your users in your existing application.
Table Of Contents
Learn more
Integrate Open SSO
This article will explain how to integrate Open SSO to your new project or existing application which is already have their own user database.
Diagram Flow
To integrate Open SSO, it will require a little programming knowledge.
For more detail, you can see the flow/diagram about how to integrate Open SSO. Click here to see the larger diagram.
Integration Open SSO to Existing Application Diagram

Steps Integration
Here is the simple steps to integrate Open SSO.
A. Get SSO URL Login Page
- Register an account then Login.
- Go to menu
My SSO - Add new
SSO
- Click Submit
- Done, then you are able to put the
SSO Urlinto your website.
- Now try to login with our Open SSO system by visiting the
SSO Urlfrom your website.
Note:
- Field Name is your application or website name.
- Field Callback is the url to redirect user back to your website including the token.
- When you update, the
KeyandCallback Urlwill always change.
B. Create Button
Create a button to your website.
|
The button will redirect user to the SSO URL Login Page. User will required to fill the form login.
C. Validate JWT Token
Once Open SSO redirect to your callback page. You have to validate the JWT token from Open SSO.
Here is the example function to decoded the JWT token in JavaScript.
|
Here is the example output of decoded JWT token.
|
Note:
uidis the user id of user.unmis the username of user.iatis identifies the time at which the JWT was issued.expis expiration time for JWT.mailis the email of user.roleis the level of user, only used in Open SSO and only has twoadminandmember.gravataris the global avatar of user.hashis the random generated string, only used for internal system.- It’s better to validate on server side than on client side. Actualy you can use any libraries to work with JWT Token.
D. Check User on Existing Database
If the token successfully validated, then you should check, is the user exist or not?
If there is no user exists, then you should register and activate it silently with user information from JWT Token to your existing application.
E. Authenticate / Allow Session
The last steps is you should giving authenticate or allow session to the user. Done.
Example or Starter Template
We offer the starter template or example scripts that already integrated with OpenSSO into your new static html or new web application.
This will saving many hours just for creating a new application.
Native:
Framework:
Note:
- BYOB - Bring Your Own Database, the starter template is not included with Database.
- The starter template was created with very minimalist so you are easier to learn.
- I’ll update to add more example script in the future.
F.A.Q
Here is the Frequent Answered Question about Integration Open SSO.
1. Is this approach safe?
Yes, we follow the JWT standard Oauth 2.0 as describe in RFC7519 and RFC9068.
2. Is Open SSO will work for mobile or any application?
Yes, of course. As long as you can integrate the Open SSO and manage the JWT token. There are plenty JWT libraries out there. Please see here.
3. Is it easy to Integrate Open SSO?
To integrate Open SSO, it will be require a little programming skill.
I would say it easy if:
- You ever made a application with user management system including login and logout.
- You ever made Login via Google or Login with Facebook.
If you don’t have any programming skill, you should hire the freelancer that have knowledge about NodeJS, JWT and programming language that used in your application.
4. Why the roles only admin and member in Open SSO?
Open SSO only authenticate user, not giving authorization to the user. Authorization must be applicable on the external application.
5. When I logout on my application, how to make my account also logout on Open SSO?
Actualy there is no way to make user logout on Open SSO from external application, Because the JWT token is saved on their device or external application, not in the Open SSO server. This is the benefit of using JWT, because it’s stateless.
For example, there many websites that using facebook login, if you logout from that website, your facebook account still logged in.
Note:
- Open SSO JWT token will expired automatically in 8 hours as default.
6. I have user login system running already, can Open SSO work as optional user login?
Yes of course, Open SSO has own user database that different with your existing application.
7. I have thousand users, is it possible to integrate SSO that would work for old registered user too?
Simple answer is, it can not. You are able to integrate Open SSO to your existing application. But it would work for new registered user only. The reason is, Open SSO has own user database and it is should be isolated.
Actual answer is, it possible, but yes, it would require complicated technical task.
8. I have old user login system, can I switch to only use Open SSO login in the future?
Yes it is possible, but this will require a complicated task and maybe you will lost your users if your user lost their email (there are possibility that some people using fake email in the past).
The steps is:
- You have to import the user data from your current application to Open SSO user database.
- You have to inform to all users to request new password via
forgot passwordon Open SSO website.
So it would better if just use your old user login system but work together with Open SSO.
9. Is it possible to use custom or other Database?
Open SSO using Sequelize libraries that work for multiple mainstream database. It is SQLite, MySQL, MariaDB, PostgreSQL and MSSQL. If your custom database not supported by Sequelize, so the answer is not possible. You may need to rewrite the Open SSO source code by your self.
10. Is it possible to run Open SSO on container cloud like docker or other SASS?
Yes it is possible, but the default Open SSO is not configured for it. You have to configured it by your self.
11. Open SSO error when I try to update the package?
That will happen because you have been update also upgrade some dependencies. If you found an error, you should find what dependencies that trigger the error. I can help you to find out about this. Just feel free to contact me.
To avoid this, you better to wait until I update the Open SSO in the future. Application that go for production, should be not too often to update.
12. My question is not here, can I contact you?
Sure, feel free to email me at [email protected].
Or just chat with me via Telegram https://t.me/aalfiann.
