2 years ago

#33543

test-img

Robert

I'm trying to convert a MSAL login from UIKit to SwiftUI and not sure how I can implement the MSALWebviewParameters into SwiftUI

I've implemented a lot of the MSAL into SwiftUI, but I'm running into a hiccup with MSALWebviewParameters which needs aUIViewController.

This is the current code portion that works with UIKit.

    @objc func buttonTapped(_ snder: UIButton) {
        do {
            <Some Code that works>
            let webViewParameters = MSALWebviewParameters(authPresentationViewController: self)
            let interactiveParameters = MSALInteractiveTokenParameters(scopes: ["user.read"], webviewParameters: webViewParameters)
            application.acquireToken(with: interactiveParameters) { (result, error) in

  }

What I'm trying to do is move that function into an ObservableObject, but these three lines depend on a UIViewController. My end goal is to move this function into a classObservableObject

swiftui

uiviewcontroller

uikit

azure-ad-msal

0 Answers

Your Answer

Accepted video resources