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

Add note on how to determine allowlist urls for expo #1693

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions docs/deployments/deploy-expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ Clerk ensures that security critical nonces will be passed only to allowlisted U

So for maximum security in your production instances, you need to allowlist your custom redirect URLs:

1. Navigate to the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections).
1. In the top navigation, select **Configure**. Then in the sidebar, select **SSO Connections**.
1. In the Clerk Dashboard, navigate to the [**SSO Connections**](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections) page.
1. Scroll to the **Allowlist for mobile OAuth redirect** section and add your redirect URLs.
1. The default is `your-app-scheme://oauth-native-callback`
1. If you'd like to pass a custom redirect url, make sure you add that to the allowlist.
1. The default is `<INSERT-YOUR-APP-SCHEME>://oauth-native-callback`
1. If you'd like to pass a custom redirect URL, make sure you add that to the allowlist. The format is `<INSERT-YOUR-APP-SCHEME>/{PATH}`. For example, the redirect URL for the following code example is `myapp://dashboard`.
```ts
const { startOAuthFlow } = useOAuth({ strategy: `oauth_apple` })

const onPress = React.useCallback(async () => {
const { createdSessionId, setActive } = await startOAuthFlow({
redirectUrl: Linking.createURL('dashboard', { scheme: 'myapp' }),
})

// The rest of your code...
}, [])
```

> [!TIP]
> You can also add redirect URLs via [the Backend API](/docs/reference/backend-api/tag/Redirect-URLs#operation/CreateRedirectURL).
Expand Down
Loading