Skip to content

iOS redirect and universal links broken if default browser not Safari #1473

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

Open
Snookmz opened this issue May 12, 2025 · 0 comments
Open

iOS redirect and universal links broken if default browser not Safari #1473

Snookmz opened this issue May 12, 2025 · 0 comments

Comments

@Snookmz
Copy link

Snookmz commented May 12, 2025

When on iOS and the default browser is NOT Safari then oAuthService.loadDiscoveryDocumentAndLogin() will redirect to the default browser (say Chrome) and after the user logs in, Chrome will NOT redirect back to the app using Universal links.

From what I understand, this is because Universal links are not supported in Chrome (or other browsers) on iOS, discussion here.

I have read that we can use the openUri parameter in the AuthConfig:

 private authCodeFlowConfig: AuthConfig = {
    issuer: 'https://accounts.google.com',
    strictDiscoveryDocumentValidation: false,
    redirectUri: <my app URL>,
    clientId: '<my client id>',
    openUri: Browser.open({url}), // SFSafariViewController will not open universal links.
    scope: 'openid profile email',
    showDebugInformation: true,
  };

This allows me to use the Browser Capacitor plugin to open SFSafariViewController. But the redirect back to the app won't work either. This is a known issue/feature.

I know this isn't a direct issue with angular-oauth2-oidc but it's an issue we face as users. Has anyone solved this?

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

No branches or pull requests

1 participant