AppAuth-iOS icon indicating copy to clipboard operation
AppAuth-iOS copied to clipboard

Impossible to login with microsoft business account

Open lukluca opened this issue 3 years ago • 2 comments

Describe the bug Impossible to login with microsoft business account

To Reproduce When we use the following function OIDAuthorizationService.discoverConfiguration(forIssuer: url) using as url "https://login.live.com", everything goes right. Since the url "https://login.live.com" is not working with business account, we wish to use the following url "https://login.microsoftonline.com" or "https://login.microsoftonline.com/common/v2.0/", but the function OIDAuthorizationService.discoverConfiguration reply with the following error

Error Domain=org.openid.appauth.general Code=-5 "JSON error parsing document at 'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration': Invalid URL: issuer" UserInfo={NSLocalizedDescription=JSON error parsing document at 'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration': Invalid URL: issuer, NSUnderlyingError=0x600000a0f360 {Error Domain=org.openid.appauth.general Code=-2 "Invalid URL: issuer" UserInfo={NSLocalizedDescription=Invalid URL: issuer}}}

so for us it's impossible to login with microsoft business account. The url provided is correct, since the same url works well on android.

Expected behavior The function OIDAuthorizationService.discoverConfiguration should complete without error.

Environment

  • Device: All iOS devices
  • OS: All iOS version, starting from iOS 10.

lukluca avatar Sep 02 '22 14:09 lukluca

I've also run into the issue, I suspect it's because for some reason microsoft has chosen to put a curly brace in the issuer url here: https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration

paulrostorp avatar Dec 23 '22 17:12 paulrostorp

https://github.com/openid/AppAuth-iOS/pull/714

paulrostorp avatar Dec 23 '22 17:12 paulrostorp