Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clerk-expo): Introduce SAML support #4880

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Jan 13, 2025

Description

Resolves ORGS-454

This PR introduces a new React hook to trigger a wider-range of SSO types such as SAML with the enterprise_sso strategy.

SAML support for native flows has been released on FAPI, and implemented by our native IOS SDK. It leverages the same rotating_token_nonce solution on SSO callback as it currently has for social OAuth.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@LauraBeatris LauraBeatris self-assigned this Jan 13, 2025
Copy link

changeset-bot bot commented Jan 13, 2025

🦋 Changeset detected

Latest commit: 988f107

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/clerk-expo Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 0:21am

@LauraBeatris LauraBeatris changed the title feat(expo): Enterprise SSO support feat(expo): SAML support Jan 13, 2025
@LauraBeatris
Copy link
Member Author

Before merging this PR, we should also raise an update to our docs: https://clerk.com/docs/references/expo/use-oauth

@LauraBeatris
Copy link
Member Author

!snapshot

@LauraBeatris LauraBeatris changed the title feat(expo): SAML support feat(expo): Introduce SAML support Jan 13, 2025
@clerk-cookie
Copy link
Collaborator

Hey @LauraBeatris - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 2.1.7-snapshot.v20250113122215
@clerk/backend 1.21.7-snapshot.v20250113122215
@clerk/chrome-extension 2.1.11-snapshot.v20250113122215
@clerk/clerk-js 5.44.0-snapshot.v20250113122215
@clerk/clerk-expo 2.7.0-snapshot.v20250113122215
@clerk/express 1.3.34-snapshot.v20250113122215
@clerk/fastify 2.1.7-snapshot.v20250113122215
@clerk/nextjs 6.9.10-snapshot.v20250113122215
@clerk/nuxt 1.0.3-snapshot.v20250113122215
@clerk/react-router 0.1.8-snapshot.v20250113122215
@clerk/remix 4.4.9-snapshot.v20250113122215
@clerk/tanstack-start 0.8.8-snapshot.v20250113122215
@clerk/testing 1.4.7-snapshot.v20250113122215

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@2.1.7-snapshot.v20250113122215 --save-exact

@clerk/backend

npm i @clerk/backend@1.21.7-snapshot.v20250113122215 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.1.11-snapshot.v20250113122215 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.44.0-snapshot.v20250113122215 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.7.0-snapshot.v20250113122215 --save-exact

@clerk/express

npm i @clerk/express@1.3.34-snapshot.v20250113122215 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.7-snapshot.v20250113122215 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.9.10-snapshot.v20250113122215 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.0.3-snapshot.v20250113122215 --save-exact

@clerk/react-router

npm i @clerk/react-router@0.1.8-snapshot.v20250113122215 --save-exact

@clerk/remix

npm i @clerk/remix@4.4.9-snapshot.v20250113122215 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.8.8-snapshot.v20250113122215 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.7-snapshot.v20250113122215 --save-exact

@LauraBeatris LauraBeatris changed the title feat(expo): Introduce SAML support feat(clerk-expo): Introduce SAML support Jan 13, 2025
@LauraBeatris
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @LauraBeatris - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 2.1.7-snapshot.v20250113125959
@clerk/backend 1.21.7-snapshot.v20250113125959
@clerk/chrome-extension 2.1.11-snapshot.v20250113125959
@clerk/clerk-js 5.44.0-snapshot.v20250113125959
@clerk/clerk-expo 2.7.0-snapshot.v20250113125959
@clerk/express 1.3.34-snapshot.v20250113125959
@clerk/fastify 2.1.7-snapshot.v20250113125959
@clerk/nextjs 6.9.10-snapshot.v20250113125959
@clerk/nuxt 1.0.3-snapshot.v20250113125959
@clerk/react-router 0.1.8-snapshot.v20250113125959
@clerk/remix 4.4.9-snapshot.v20250113125959
@clerk/tanstack-start 0.8.8-snapshot.v20250113125959
@clerk/testing 1.4.7-snapshot.v20250113125959

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@2.1.7-snapshot.v20250113125959 --save-exact

@clerk/backend

npm i @clerk/backend@1.21.7-snapshot.v20250113125959 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.1.11-snapshot.v20250113125959 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.44.0-snapshot.v20250113125959 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.7.0-snapshot.v20250113125959 --save-exact

@clerk/express

npm i @clerk/express@1.3.34-snapshot.v20250113125959 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.7-snapshot.v20250113125959 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.9.10-snapshot.v20250113125959 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.0.3-snapshot.v20250113125959 --save-exact

@clerk/react-router

npm i @clerk/react-router@0.1.8-snapshot.v20250113125959 --save-exact

@clerk/remix

npm i @clerk/remix@4.4.9-snapshot.v20250113125959 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.8.8-snapshot.v20250113125959 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.7-snapshot.v20250113125959 --save-exact

@clerk-cookie
Copy link
Collaborator

Hey @LauraBeatris - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 2.1.8-snapshot.v20250114202908
@clerk/backend 1.22.1-snapshot.v20250114202908
@clerk/chrome-extension 2.1.12-snapshot.v20250114202908
@clerk/clerk-js 5.44.1-snapshot.v20250114202908
@clerk/clerk-expo 2.7.0-snapshot.v20250114202908
@clerk/express 1.3.35-snapshot.v20250114202908
@clerk/fastify 2.1.8-snapshot.v20250114202908
@clerk/nextjs 6.9.11-snapshot.v20250114202908
@clerk/nuxt 1.0.4-snapshot.v20250114202908
@clerk/react-router 0.1.9-snapshot.v20250114202908
@clerk/remix 4.4.10-snapshot.v20250114202908
@clerk/tanstack-start 0.8.9-snapshot.v20250114202908
@clerk/testing 1.4.8-snapshot.v20250114202908
@clerk/vue 1.0.3-snapshot.v20250114202908

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@2.1.8-snapshot.v20250114202908 --save-exact

@clerk/backend

npm i @clerk/backend@1.22.1-snapshot.v20250114202908 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.1.12-snapshot.v20250114202908 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.44.1-snapshot.v20250114202908 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.7.0-snapshot.v20250114202908 --save-exact

@clerk/express

npm i @clerk/express@1.3.35-snapshot.v20250114202908 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.8-snapshot.v20250114202908 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.9.11-snapshot.v20250114202908 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.0.4-snapshot.v20250114202908 --save-exact

@clerk/react-router

npm i @clerk/react-router@0.1.9-snapshot.v20250114202908 --save-exact

@clerk/remix

npm i @clerk/remix@4.4.10-snapshot.v20250114202908 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.8.9-snapshot.v20250114202908 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.8-snapshot.v20250114202908 --save-exact

@clerk/vue

npm i @clerk/vue@1.0.3-snapshot.v20250114202908 --save-exact

@LauraBeatris
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @LauraBeatris - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 2.1.8-snapshot.v20250114213345
@clerk/backend 1.22.1-snapshot.v20250114213345
@clerk/chrome-extension 2.1.12-snapshot.v20250114213345
@clerk/clerk-js 5.44.1-snapshot.v20250114213345
@clerk/clerk-expo 2.7.0-snapshot.v20250114213345
@clerk/express 1.3.35-snapshot.v20250114213345
@clerk/fastify 2.1.8-snapshot.v20250114213345
@clerk/nextjs 6.9.11-snapshot.v20250114213345
@clerk/nuxt 1.0.4-snapshot.v20250114213345
@clerk/react-router 0.1.9-snapshot.v20250114213345
@clerk/remix 4.4.10-snapshot.v20250114213345
@clerk/tanstack-start 0.8.9-snapshot.v20250114213345
@clerk/testing 1.4.8-snapshot.v20250114213345
@clerk/vue 1.0.3-snapshot.v20250114213345

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@2.1.8-snapshot.v20250114213345 --save-exact

@clerk/backend

npm i @clerk/backend@1.22.1-snapshot.v20250114213345 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.1.12-snapshot.v20250114213345 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.44.1-snapshot.v20250114213345 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.7.0-snapshot.v20250114213345 --save-exact

@clerk/express

npm i @clerk/express@1.3.35-snapshot.v20250114213345 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.8-snapshot.v20250114213345 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.9.11-snapshot.v20250114213345 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.0.4-snapshot.v20250114213345 --save-exact

@clerk/react-router

npm i @clerk/react-router@0.1.9-snapshot.v20250114213345 --save-exact

@clerk/remix

npm i @clerk/remix@4.4.10-snapshot.v20250114213345 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.8.9-snapshot.v20250114213345 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.8-snapshot.v20250114213345 --save-exact

@clerk/vue

npm i @clerk/vue@1.0.3-snapshot.v20250114213345 --save-exact

@LauraBeatris
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @LauraBeatris - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 2.1.8-snapshot.v20250114221021
@clerk/backend 1.22.1-snapshot.v20250114221021
@clerk/chrome-extension 2.1.12-snapshot.v20250114221021
@clerk/clerk-js 5.44.1-snapshot.v20250114221021
@clerk/clerk-expo 2.7.0-snapshot.v20250114221021
@clerk/express 1.3.35-snapshot.v20250114221021
@clerk/fastify 2.1.8-snapshot.v20250114221021
@clerk/nextjs 6.9.11-snapshot.v20250114221021
@clerk/nuxt 1.0.4-snapshot.v20250114221021
@clerk/react-router 0.1.9-snapshot.v20250114221021
@clerk/remix 4.4.10-snapshot.v20250114221021
@clerk/tanstack-start 0.8.9-snapshot.v20250114221021
@clerk/testing 1.4.8-snapshot.v20250114221021
@clerk/vue 1.0.3-snapshot.v20250114221021

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@2.1.8-snapshot.v20250114221021 --save-exact

@clerk/backend

npm i @clerk/backend@1.22.1-snapshot.v20250114221021 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.1.12-snapshot.v20250114221021 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.44.1-snapshot.v20250114221021 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.7.0-snapshot.v20250114221021 --save-exact

@clerk/express

npm i @clerk/express@1.3.35-snapshot.v20250114221021 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.8-snapshot.v20250114221021 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.9.11-snapshot.v20250114221021 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.0.4-snapshot.v20250114221021 --save-exact

@clerk/react-router

npm i @clerk/react-router@0.1.9-snapshot.v20250114221021 --save-exact

@clerk/remix

npm i @clerk/remix@4.4.10-snapshot.v20250114221021 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.8.9-snapshot.v20250114221021 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.8-snapshot.v20250114221021 --save-exact

@clerk/vue

npm i @clerk/vue@1.0.3-snapshot.v20250114221021 --save-exact

@NicolasLopes7
Copy link
Contributor

!snapshot

@NicolasLopes7
Copy link
Contributor

!snapshot

1 similar comment
@LauraBeatris
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @LauraBeatris - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 2.1.8-snapshot.v20250114233231
@clerk/backend 1.22.1-snapshot.v20250114233231
@clerk/chrome-extension 2.1.12-snapshot.v20250114233231
@clerk/clerk-js 5.44.1-snapshot.v20250114233231
@clerk/clerk-expo 2.7.0-snapshot.v20250114233231
@clerk/express 1.3.35-snapshot.v20250114233231
@clerk/fastify 2.1.8-snapshot.v20250114233231
@clerk/nextjs 6.9.11-snapshot.v20250114233231
@clerk/nuxt 1.0.4-snapshot.v20250114233231
@clerk/react-router 0.1.9-snapshot.v20250114233231
@clerk/remix 4.4.10-snapshot.v20250114233231
@clerk/tanstack-start 0.8.9-snapshot.v20250114233231
@clerk/testing 1.4.8-snapshot.v20250114233231
@clerk/vue 1.0.3-snapshot.v20250114233231

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@2.1.8-snapshot.v20250114233231 --save-exact

@clerk/backend

npm i @clerk/backend@1.22.1-snapshot.v20250114233231 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.1.12-snapshot.v20250114233231 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.44.1-snapshot.v20250114233231 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.7.0-snapshot.v20250114233231 --save-exact

@clerk/express

npm i @clerk/express@1.3.35-snapshot.v20250114233231 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.8-snapshot.v20250114233231 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.9.11-snapshot.v20250114233231 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.0.4-snapshot.v20250114233231 --save-exact

@clerk/react-router

npm i @clerk/react-router@0.1.9-snapshot.v20250114233231 --save-exact

@clerk/remix

npm i @clerk/remix@4.4.10-snapshot.v20250114233231 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.8.9-snapshot.v20250114233231 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.8-snapshot.v20250114233231 --save-exact

@clerk/vue

npm i @clerk/vue@1.0.3-snapshot.v20250114233231 --save-exact

@LauraBeatris
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @LauraBeatris - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 2.1.8-snapshot.v20250115001249
@clerk/backend 1.22.1-snapshot.v20250115001249
@clerk/chrome-extension 2.1.12-snapshot.v20250115001249
@clerk/clerk-js 5.44.1-snapshot.v20250115001249
@clerk/clerk-expo 2.7.0-snapshot.v20250115001249
@clerk/express 1.3.35-snapshot.v20250115001249
@clerk/fastify 2.1.8-snapshot.v20250115001249
@clerk/nextjs 6.9.11-snapshot.v20250115001249
@clerk/nuxt 1.0.4-snapshot.v20250115001249
@clerk/react-router 0.1.9-snapshot.v20250115001249
@clerk/remix 4.4.10-snapshot.v20250115001249
@clerk/tanstack-start 0.8.9-snapshot.v20250115001249
@clerk/testing 1.4.8-snapshot.v20250115001249
@clerk/vue 1.0.3-snapshot.v20250115001249

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@2.1.8-snapshot.v20250115001249 --save-exact

@clerk/backend

npm i @clerk/backend@1.22.1-snapshot.v20250115001249 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.1.12-snapshot.v20250115001249 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.44.1-snapshot.v20250115001249 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.7.0-snapshot.v20250115001249 --save-exact

@clerk/express

npm i @clerk/express@1.3.35-snapshot.v20250115001249 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.8-snapshot.v20250115001249 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.9.11-snapshot.v20250115001249 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.0.4-snapshot.v20250115001249 --save-exact

@clerk/react-router

npm i @clerk/react-router@0.1.9-snapshot.v20250115001249 --save-exact

@clerk/remix

npm i @clerk/remix@4.4.10-snapshot.v20250115001249 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.8.9-snapshot.v20250115001249 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.8-snapshot.v20250115001249 --save-exact

@clerk/vue

npm i @clerk/vue@1.0.3-snapshot.v20250115001249 --save-exact


let createdSessionId = signIn.createdSessionId;

const redirectUrl =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A weird behavior is happening with deep linking back from the web browser tab. On expo web, it flows like this:

  • Identity Provider redirects to FAPI /acs
  • FAPI /acs redirects to application's redirect URL on that same tab
  • Expo closes that tab and redirects back to the app but remains on the same page

On mobile, it's not linking to the actual page on the stack. I'll have to perform more testing tomorrow to better understand that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants