AzureAD/microsoft-authentication-library-common-for-objc

add ability to deauthorize user by storing cookies in non-persistent data store

dsmelov opened this issue · 5 comments

MSIDWebviewUIController.m:

+ (void)initialize
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        s_webConfig = [WKWebViewConfiguration new];
        s_webConfig.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];
    });
}

This can be achieved by passing MSAL your own instance of WKWebView: https://azuread.github.io/microsoft-authentication-library-for-objc/Classes/MSALWebviewParameters.html#/c:objc(cs)MSALWebviewParameters(py)customWebview. You can configure it the way you need including using non persistent data store, then show this WKWebView in your application, and pass it to MSAL.

Olga,
Thanks for you response. But what about ADAL?

ADAL also supports passing your own webview, so you can provide custom WKWebViewConfiguration the same way.

Olga,

Could you please provide a link to a working sample or documentation how to use custom WKWebView with ADAL?

You'd need to initialize an instance of ADAuthenticationContext and set a WebView on it. You can see a sample in our test app: https://github.com/AzureAD/azure-activedirectory-library-for-objc/blob/master/ADAL/tests/app/src/ios/ADTestAppAcquireTokenViewController.m#L666