Skip to Content
DocumentationActionGuidesUse third-party sign-in

Use third-party sign-in

Third-party sign-in (SSO) lets users authenticate through an external identity provider. Momen starts authorization, handles the callback, and associates the identity with an account. Profile attributes such as name or email are not synchronized to the account table automatically; process any attributes you need in an Actionflow after third-party sign-in succeeds.

Set up third-party sign-in

Add a third-party sign-in provider

Open Action → Sign in → Third-party sign-in, select Add, and choose an identity provider.

Momen generates a callback URL for the configuration. You will add this URL to the provider’s OAuth or OIDC application.

Register an application with the provider

Create a Web application in the provider’s developer console and configure:

  • App name, homepage, privacy policy, and terms of service
  • Authorized origin, if required by the provider
  • The callback URL generated by Momen
  • The minimum scopes required by your app
⚠️

The callback URL must exactly match the URL shown in Momen, including its scheme, host, path, and trailing slash. Do not use the published app URL as the callback URL.

Copy the client ID and client secret after creating the application. The client secret is sensitive and must not be placed in a page, client variable, or frontend code.

Complete the provider settings

Return to Momen and fill in the fields required for the selected provider, such as:

FieldDescription
clientIdClient ID generated by the provider
clientSecretClient secret generated by the provider
scopeRequested scopes, separated as required by the provider
authorizationUriEndpoint that starts user authorization
tokenUriEndpoint that exchanges the authorization code for tokens
userInfoUriEndpoint that returns user profile data
userIdAttributeStable profile field used as the unique identity

The visible fields depend on the provider. Follow its OAuth/OIDC documentation and the required markers in Momen, then save and enable the third-party sign-in configuration.

Google example

For Google, create a Web application client under Google Auth Platform:

  1. Complete the app branding, audience, and data-access settings required by Google.
  2. Add the Momen callback URL under Authorized redirect URIs.
  3. Add the published app origin under Authorized JavaScript origins only when required by the Google client configuration.
  4. Copy the client ID and client secret to Momen.
  5. Use email profile as the basic profile scope unless the app requires additional Google permissions.

Google requires the redirect URI in an authorization request to exactly match an authorized redirect URI. A different scheme, path, case, or trailing slash can cause redirect_uri_mismatch.

Add third-party sign-in actions

Under a page or component Trigger, choose the relevant user action:

ActionPurpose
Third-party sign-inSign in an existing bound account, or create an account and bind the third-party sign-in identity
Bind third-party sign-in infoBind a third-party sign-in identity to the currently signed-in account
Unbind third-party sign-inRemove the third-party sign-in identity from the current account

Third-party sign-in authorization leaves the current page and returns through a redirect. Page variables and later frontend actions from the original page do not continue. Run any required follow-up logic through an Actionflow configured for third-party sign-in success.

Process profile data

Provider profile data is not synchronized to the account table automatically. To store a name, email, avatar, or another attribute:

  1. Add custom fields to the account table for the profile data your app needs.
  2. Create an Actionflow and read the third-party sign-in account ID and profile data in a Run code node.
  3. Inspect the provider’s actual response and expose only the fields needed by later nodes.
  4. Use a database Update node filtered by the account ID to write those values to the account custom fields.
  5. Call this Actionflow after Third-party sign-in succeeds.

Read the third-party sign-in context in a Run code node:

const accountId = context.getSsoAccountId() const userInfo = JSON.parse(context.getSsoUserInfo()) return { accountId, userInfo, }

Profile shapes differ by provider. Inspect userInfo in the Actionflow logs before defining Run code outputs or database mappings. Do not assume that username, email, or another attribute is always present.

Publish and test

Publish the third-party sign-in, Actionflow, and page changes, then test the complete flow while signed out:

  1. Start third-party sign-in.
  2. Authorize on the provider’s page.
  3. Confirm that the browser returns to the app and signs in.
  4. Verify the account binding and any custom profile fields.
  5. Sign in again with the same identity and confirm that no duplicate account is created.

Troubleshooting

  1. The provider reports a redirect mismatch: Compare the Momen callback URL and the provider configuration character by character, including scheme and trailing slash.
  2. Authorization completes but sign-in fails: Check the client ID, client secret, token endpoint, user-info endpoint, and unique user ID attribute.
  3. Sign-in works but profile data is missing: Confirm that the scope grants access to the attribute and inspect the provider’s actual userInfo response.
  4. Frontend actions after third-party sign-in do not run: Third-party sign-in redirects away from the page. Put required follow-up logic in the Actionflow called after third-party sign-in succeeds.
  5. One identity creates multiple accounts: Use the provider’s stable unique user identifier for userIdAttribute, not a display name that can change or collide.
Last updated on