Closed pranitl closed 9 months ago
@rasterize-art the SSO example requires an organizationId
be passed into the getAuthorizationUrl
method, this way WorkOS would know which identity provider to send the user to (Azure AD, Okta, etc...). If you don't care to try SSO, you can comment out this example for testing purposes. The other examples only require a clientId
be passed (plus an API key to instantiate workos
).
export default function SignInWithSSO({
searchParams,
}: {
searchParams: { [key: string]: string | string[] | undefined };
}) {
// const ssoUrl = workos.userManagement.getAuthorizationUrl({
// clientId: process.env.WORKOS_CLIENT_ID || '',
// organizationId: process.env.SSO_ENABLED_ORGANIZATION_ID || '',
// redirectUri: 'http://localhost:3000/using-your-own-ui/sign-in/sso/callback',
// });
const result = JSON.parse(String(searchParams.response ?? '{ "error": null }'));
return (
<main>
<h1>Sign-in</h1>
<h2>Single Sign-On</h2>
{/* <a href={ssoUrl}>Continue with SSO</a> */}
<pre>{JSON.stringify(result, null, 2)}</pre>
</main>
);
}
Im getting an error when trying to build this app where the
getAuthorizationUrl
method is being called with aclientId
,organizationId
, andredirectUri
. TheorganizationId
is being fetched from the environment variableSSO_ENABLED_ORGANIZATION_ID
. I don't have any need for this because I'm just testing this out locally. As such the environment variable is not set, it could be the cause of the error. Are there any remedies for this?