2

When using SFAuthenticationSession or ASWebAuthenticationSession the user is currently prompted to give consent every time the window is presented.

At some point the user opts to Sign Out and again is presented with a UIAlert asking their consent to Sign In

The user is signed in, trying to sign out and is being prompted to give their consent to sign in - so they may be signed out

Plus, when trying to open a web page requiring the same app authentication using ASWebAuthenticationSession the dialog is presented and when using other browser like SFSafariViewController the user is not authenticated.

  • Can you please add some codes or screenshots to make your question clear? If the alert is present by `ASWebAuthenticationSession`, I think it's probably by design. – nevermore Nov 13 '19 at 06:02
  • Yes there's no way to bypass this dialog, I did a workaround by using SFSafariViewController instead of ASWebAuthenticationSession. it's not recommended but it did the trick. thank you – Liwa'a Awar Nov 13 '19 at 08:40

1 Answers1

3

If you don't want the consent dialog to appear, just set prefersEphemeralWebBrowserSession to true on the ASWebAuthenticationSession object. Setting this property to true bevor starting the session bypasses the dialog but it also avoids Single Sign On (SSO). If you just want to login with your App you're good to go, but if you also have a WebSite supporting your App the user needs to login there again. The property is available in iOS 13 and higher.

Joachim Deelen
  • 1,021
  • 10
  • 8