SSO
SSO: A mechanism that allows users to access multiple related systems via a single verification. After configuring SSO, new users entering your website can use their existing accounts to login.
Last updated
SSO: A mechanism that allows users to access multiple related systems via a single verification. After configuring SSO, new users entering your website can use their existing accounts to login.
Last updated
Single Sign-On (SSO) is a system that enables users to access multiple accounts with a single set of credentials. Once configured, new users can effortlessly register and log in to your website using their existing accounts, such as Google or Facebook. SSO has the following advantages:
Improved User Experience: Users can access multiple applications with a single login, reducing the need for repetitive logins and enhancing the overall user experience.
Enhanced Security: SSO allows for controlled access to applications, offering greater security compared to traditional username and password authentication.
Reduced Administrative Burden: SSO significantly reduces the workload for administrators managing multiple applications and systems.
Configuring SSO involves the following key steps:
Create a new SSO configuration in Momen and get the callback address.
Register your application with the identity provider and provide the callback address.
Return to Momen and input your application details (clientId, clientSecret, etc.).
Configure the appropriate actions on your web pages.
Begin by creating a new project, opening the project settings, and locating "Single Sign-On Method," then click "Add."
You'll notice that the callback address is automatically generated. The SSO process works as follows:
Users click "Login" on your website, which redirects them to the provider's authorization page (e.g., Google login page).
Users enter their information (email, password, etc.) on the authorization page to complete the authorization.
After successful authorization, users are redirected back to your website via the callback address.
Using Google as an example, you'll need to register your app and provide the callback address obtained in the previous step (the process may vary between providers).
Register as a Google developer: https://console.cloud.google.com/. After registering, click on Create a new project.
Create a new project. Select API and Services.
Select External user type in OAuth consent screen. Hit create.
Back to your project. Create a "Private Policy" page. Modify the HTML path into privacy. Complete the privacy content. And design the button in your website that could direct to privacy page.
Complete the configuration of OAuth content.
Set scopes Add /auth/userinfo.email and /auth/userinfo.profile to obtain user's basic information
Complete the following configurations. Save and continue.
Create credentials. Create client ID for web application.
Fill in the OAuth client ID information, the application type is Web, and the name is customizable.
Authorized JavaScript Origin: The link after your project has been successfully published.
Authorized Redirect URLs: The callback address under the SSO configuration added to your project, click on the address to copy.
Obtain the Client Id and Client Secret for your application.
Choose an SSO name that does not start with "fz" or repeat existing names.
Copy the Client Id and Client Secret obtained earlier.
The scope option determines which account information (e.g., username, avatar) can be accessed. The available scope options vary among providers, so be sure to check the available options when configuring.
There is also information about the authorization method, type, and more, which must be filled out according to the specific requirements of your chosen provider.
Once your configuration is complete, save the settings and turn on the SSO switch.
Next, you can configure the corresponding actions on the page. There are three actions related to SSO:
Register/Login: After SSO authorization, if the SSO information exists in the account table, the user logs in with this account. Otherwise, a new user is registered and linked to the SSO.
Bind: After SSO authorization, the user binds their account to the currently logged-in account. If there is no active session or other accounts are already linked to the SSO, binding will fail.
Unbind: Allows users to unlink their current account from SSO.
For instance, let's consider the registration/login action. The configuration involves connecting SSO and the corresponding web page. Note that after successful SSO authorization, users are redirected to another page, making it impossible to utilize the data and actions of the original page. Thus, most actions cannot be configured upon successful SSO authorization, except for custom actions that run in the background.
In the default account table of the data model, add an email field of the text type. After adding, update the backend.
Add the following code block in ActionFlow. After adding, save and update the backend.
Request the ActionFlow when SSO is successful to obtain and update the user information.
The effect of successful configuration
Momen is a no-code web app builder, allows users to build fully customizable web apps, marketplaces, Social Networks, AI Apps, Enterprise SaaS, and much more. You can iterate and refine your projects in real-time, ensuring a seamless creation process. Meanwhile, Momen offers powerful API integration capabilities, allowing you to connect your projects to any service you need. With Momen, you can bring your ideas to life and build remarkable digital solutions and get your web app products to market faster than ever before.