AppAuth-iOS icon indicating copy to clipboard operation
AppAuth-iOS copied to clipboard

System safari is not redirecting back to native iOS app with url scheme

Open chintu-github opened this issue 5 years ago • 8 comments

Issue description:

I am building a native ios app using AppAuth library. In this flow, I am taking help of AppAuth to launch a webpage inside the app and authorize there. Once authorization is done, I need to do an email verification flow. So I am going outside of the app and launching system safari browser to log in my email id and click the verification link. Earlier that verification link had custom URI scheme but now it's removed as cookies have been made persistent. But after doing email verification it's not able to redirect back to the native ios app. I have added URL types in s info.plist of ios app. Earlier redirection was happening as URI scheme was present in verification link. But if I understand as persistent cookies are there it should able to handle redirection.

Need help from AppAuth team for this.

chintu-github avatar Aug 21 '19 09:08 chintu-github

From what I understand you successfully implemented the authorization flow using AppAuth, is that right?

The "email verification flow" you mention seems to be beyond the scope of AppAuth and the authorization flow. Can you explain how is this related to AppAuth? Did you find a bug in AppAuth?

julienbodet avatar Aug 22 '19 00:08 julienbodet

This is not related to appauth issue but wanted to check with team whatever problem i am facing. Yes, I implemented app auth flow correctly. there is no issue with that. As app auth is opening the webpage with SFAuthenticationsession so if backend has made persistent cookies for safari, then if I open any URL outside of my app that session should persist with system browser also right.

chintu-github avatar Aug 22 '19 06:08 chintu-github

Session cookies set in ASWebAuthenticationSession (SFAuthenticationSession replacement for iOS12+) are not shared with the browser as per documentation.

julienbodet avatar Aug 22 '19 13:08 julienbodet

I am facing same issue. When I checked the redirected webpage it is detecting the cookies left by the ASWeb/SFAuth session but its not providing the redirect URL from which app is launched. Not able to understand the problem as this works sometimes and fails sometimes..

shravankumarbj avatar Oct 24 '19 11:10 shravankumarbj

From what I understand you successfully implemented the authorization flow using AppAuth, is that right?

The "email verification flow" you mention seems to be beyond the scope of AppAuth and the authorization flow. Can you explain how is this related to AppAuth? Did you find a bug in AppAuth?

In my case, authentication flow is getting successful but when it comes to redirect back to app, redirect URL is continuing. I can't find any way to redirect back to app.

diptiy avatar Aug 18 '20 09:08 diptiy

The flow we're following here is

  • The user launches the app and asked to log in or register using Keycloak
  • User redirected to keycloak page where he tries to register
  • Email verification is mandatory to complete the registration. So the user will be asked to verify the email when he fills in the registration form.
  • User receives the verification email in his inbox. Opens in the safari inside the mobile device. Now when the verification is done user is not redirected inside the application. Instead, he is left in the safari browser only. Is there any way to handle this by redirecting the user inside the application. But a similar case in App Auth Android library works fine. Please check

@julienbodet

punithbm avatar Aug 26 '20 05:08 punithbm

@julienbodet Please let us know on this

punithbm avatar Aug 31 '20 03:08 punithbm

I am also having the exact same issue where the control did not get back in the app after successful openemr authentication.

Please suggest.

VinodComlink avatar Aug 02 '22 05:08 VinodComlink

Hi, I am facing the same issue too during the reset password flow. The user is not redirected to the iOS app and stay on the browser (safari for me). It works well on Android indeed but we don't understand how/why it works or not, depending on plateform. We try many things with deeplink but nothing work.

Have you any suggestions that we could try to manage this ?

StevenWatremez avatar Jun 14 '23 08:06 StevenWatremez

Hi.. we fixed the issue..it's the redirect url what you provide while launching safari matters else update ur plist with uri scheme.

Regards, Shravana


From: Steven Watremez @.> Sent: Wednesday, June 14, 2023 2:05:41 PM To: openid/AppAuth-iOS @.> Cc: shravankumarbj @.>; Comment @.> Subject: Re: [openid/AppAuth-iOS] System safari is not redirecting back to native iOS app with url scheme (#432)

Hi, I am facing the same issue too during the rest password flow. The user is not redirected to the iOS app and stay on the the browser (safari for me). It works well on Android indeed but we don't understand how/why it works or not depending on plateform. We try many things with deeplink but nothing work.

Have you any suggestions that we could try to manage this ?

— Reply to this email directly, view it on GitHubhttps://github.com/openid/AppAuth-iOS/issues/432#issuecomment-1590736875, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAENUIVH7IK6LFBCJKWFWLTXLFZV3ANCNFSM4IOD6HWA. You are receiving this because you commented.Message ID: @.***>

shravankumarbj avatar Jun 14 '23 08:06 shravankumarbj

It was quite of long time but yes, It was myself and there is no such issue in our app.

VinodComlink avatar Jun 14 '23 08:06 VinodComlink