Skip to content

Documentation / @frak-labs/core-sdk / actions / openSso

Function: openSso()

openSso(client, args): Promise<OpenSsoReturnType>

Defined in: actions/openSso.ts:68

Function used to open the SSO

Parameters

client

FrakClient

The current Frak Client

args

OpenSsoParamsType

The SSO parameters

Returns

Promise<OpenSsoReturnType>

Example

First we build the sso metadata

// Build the metadata
const metadata: SsoMetadata = {
    logoUrl: "https://my-app.com/logo.png",
    homepageLink: "https://my-app.com",
};

Then, either use it with direct exit (and so user is directly redirected to your website), or a custom redirect URL

Popup (default)
// Opens in popup, SDK generates URL automatically
await openSso(frakConfig, {
    directExit: true,
    metadata,
});