FormidableLabs / react-native-app-auth

React native bridge for AppAuth - an SDK for communicating with OAuth2 providers
https://commerce.nearform.com/open-source/react-native-app-auth
MIT License
2.04k stars 441 forks source link

[iOS] Universal link not working as redirect URI #987

Open matjua17 opened 5 months ago

matjua17 commented 5 months ago

Issue

Hi,

I am facing the problem that my https redirect URI is not working when using the normal authentication through the browser popup window. However, if I set the customBrowser to Safari, it works. This will open up the Safari browser in a external window. After swichting back to the popup window it works, but only for a limited time. After some time the Universal links stop working (Properly because the associated domains are cached somehow?). I have the feeling the apple app site association file is not loaded correctly, when the external browser is not opened once.

The use of the external (or default web browser) variant is not accepted by Apple App Review anymore, because of bad user experience.

If anyone could solve this problem, please contact me!

Thanks!

Environment

Keycloak

carbonrobot commented 5 months ago

Can you tell me a little more about your setup, with an example code configuration and the provider you are using? We have started seeing similar issues in other frameworks.

RNAA uses AppAuth-iOS under the covers, which performs all the browser handling. AppAuth-iOS was updated a while ago to use the new ASWebAuthenticationSession and in-app browser tabs to avoid the problems with external browsers.

You could also try using react-native-app-auth@7.2.0 which uses a newer version of AppAuth-iOS.

matjua17 commented 5 months ago

Hi @carbonrobot, i just found that: Custom Scheme URI safe in ASWebAuthenticationSession. We migrated from custom scheme URIs to Universal Links because they were unsafe. With the custom scheme URI we had no problems. But we will try to update the RNAA to the latest version and try it out there.