Closed jthake closed 6 years ago
This appears to do with running MSAL in debug mode on app on device. Wifi of seems to fix this. Can't replicate on actual device not in debug mode.
I finally worked out that I needed to take the below code out of the viewDidLoad to viewDidAppear and this seems to have resolved this issue. The samples may need updating to stop others making this mistake.
if try self.applicationContext.users().isEmpty {
throw NSError.init(domain: "MSALErrorDomain", code: MSALErrorCode.interactionRequired.rawValue, userInfo: nil)
} else {
try self.applicationContext.acquireTokenSilent(forScopes: msalManager.kScopes, user: applicationContext.users().first) { (result, error) in
if error == nil {
self.accessToken = (result?.accessToken)!
self.getUser()
} else {
print("Could not acquire token silently: \(error ?? "No error informarion" as! Error)")
}
}
}
This is a weird error I just can't seem to lock down. WHen it launches the UI to show the sign in pages, it sits on a white page. But if I turn wifi off on my iPhone, the login page renders properly. I don't see any errors being logged or output anywhere.
Has anyone seen this?