Do your users get annoyed by the privacy prompt in iOS (13+) during logon?
The prompt is meant to let users know that they are being tracked using cookies. However, it can be annoying to the users. There is a way to hide it.
If you are developing on native iOS platform, it can be hidden by settings “prefersEphemeralWebBrowserSession
” to true on browser before calling start method.
MSAL.NET provides a way to hide the prompt in version 4.31. SystemWebViewOptions
has a new property iOSHidePrivacyPrompt
. By default, this property is false. When the property is set to true and the options is added to PublicClientApplicationBuilder
, it will hide the prompt.
e.g.
// Hide the privacy prompt
SystemWebViewOptions systemWebViewOptions = new SystemWebViewOptions()
{
iOSHidePrivacyPrompt = true,
};
var authResult = await App.PCA.AcquireTokenInteractive(App.Scopes)
.WithParentActivityOrWindow(App.ParentWindow)
.WithSystemWebViewOptions(systemWebViewOptions)
.ExecuteAsync();
This can be added to the common code across the platforms as it ignores the platforms where it is not applicable. Updated sample can be seen here.