Azure-Samples / active-directory-b2c-ios-swift-native-msal

An iOS sample in Swift that authenticates Azure AD B2C users and calls an API using OAuth 2.0
https://aka.ms/aadb2c
MIT License
46 stars 22 forks source link

Cancel button in toolbar app #25

Closed eltonjhony closed 4 years ago

eltonjhony commented 4 years ago

Hi,

Is there a way to remove the CANCEL button in the App left item bar?

Screenshot at Jan 17 10-35-31
jennyf19 commented 4 years ago

fyi: @oldalton

oldalton commented 4 years ago

You can create your own fully custom UI by passing MSAL your web view. See documentation here: https://azuread.github.io/microsoft-authentication-library-for-objc/Classes/MSALWebviewParameters.html#/c:objc(cs)MSALWebviewParameters(py)customWebview

However, it looks like you're using WKWebView configuration with MSAL. We recommend using the default webview configuration instead. Your users might experience extra credential prompts otherwise. Please see more information here: https://docs.microsoft.com/en-us/azure/active-directory/develop/customize-webviews

eltonjhony commented 4 years ago

Hi @oldalton

Thanks for the response!

Is the customWebView prepared to work with MSALWebviewType.wkWebView for B2C connections? I tested here and seems to not be working:

let webConfiguration = WKWebViewConfiguration()
let webView = WKWebView(frame: .zero, configuration: webConfiguration)

webViewParameters.webviewType = .wkWebView
webViewParameters.customWebview = webView

We know that is not the recommended solution, but we need to open the screen inside a WKWebView instead of a default web browser to meet UI requirements.

oldalton commented 4 years ago

You also need to display that WKWebView somewhere, by either adding it as a subview in code or adding it in the interface builder.

eltonjhony commented 4 years ago

Thank you @oldalton !