Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Jan 13, 2025
1 parent 1fc5493 commit dfd309d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .changeset/selfish-worms-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@clerk/clerk-expo': minor
---

Introduces support for SSO with SAML

- Rename `useOAuth` to `useSso` to support a wider range of protocols
- Update default redirect URI to from `oauth-native-callback` to `sso-native-callback`
8 changes: 4 additions & 4 deletions packages/expo/src/hooks/useSso.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ export function useSso(useSsoParams: UseSsoParams) {
//
// For more information go to:
// https://docs.expo.dev/versions/latest/sdk/auth-session/#authsessionmakeredirecturi
const redirectUrl =
const oauthRedirectUrl =
startSsoFlowParams?.redirectUrl ||
useSsoParams.redirectUrl ||
AuthSession.makeRedirectUri({
path: 'sso-native-callback',
});

await signIn.create({ strategy, redirectUrl });
await signIn.create({ strategy, redirectUrl: oauthRedirectUrl });

const { externalVerificationRedirectURL } = signIn.firstFactorVerification;

Expand All @@ -67,10 +67,10 @@ export function useSso(useSsoParams: UseSsoParams) {

const authSessionResult = await WebBrowser.openAuthSessionAsync(
externalVerificationRedirectURL.toString(),
redirectUrl,
oauthRedirectUrl,
);

// @ts-ignore
// @ts-expect-error
const { type, url } = authSessionResult || {};

// TODO: Check all the possible AuthSession results
Expand Down

0 comments on commit dfd309d

Please sign in to comment.