SSO Module
Single Sign-On (SSO) support for authenticating Base44 users with external systems. Available viabase44.asServiceRole.sso.
Backend only: This module requires service role access and can only be used in Base44-hosted backend functions.
Methods
Use
getIdToken(userId) when you need identity claims, especially the user’s email claim. Use getAccessToken(userId) when you need a token to authorize requests to an external system.
The service-role client must include an on-behalf-of token for the same user passed to getIdToken.
Examples
Get SSO Access Token
Get Token for a Specific User (Service Role)
Get an ID Token for the User’s Email Claim
Use an ID token instead of an access token when you need the user’s email claim. The ID token is a JWT containing identity claims from the SSO provider. Validate and decode the token according to your provider’s requirements before using its claims.Use Cases
- Authenticating Base44 users with external SaaS tools (e.g., Okta, Azure AD)
- Building SSO bridges between Base44 and third-party systems
- Generating tokens for backend-to-backend authenticated calls