简体   繁体   中英

ADAL iOS Redirect URI must be http(s)?

I'm working to get ADAL auth working in my iOS app (Xcode 8, running on iOS 10) using the latest version of the ADALiOS library (2.2.5) and have configured the authContext according to the documentation , but I'm receiving the following error:

AADSTS50011: Reply address 'x-msauth-<appname>://<app bundle id>/' 
specified by the request is not a valid URL. Allowed schemes: 'http, https'

This error message directly conflicts with the documentation which explicitly calls for the Redirect URI to be an iOS app URL, not a web URL:

Redirect URI

This adds extra requirements on your redirect URI. Your redirect URI must be in the proper form.

<app-scheme>://<your.bundle.id>
ex: x-msauth-mytestiosapp://com.microsoft.mytestiosapp

This Redirect URI needs to be registered on the app portal as a valid redirect URI. Additionally a second "msauth" form needs to be registered to handle certificate authentication in Azure Authenticator.

msauth://code/<broker-redirect-uri-in-url-encoded-form>
ex: msauth://code/x-msauth-mytestiosapp%3A%2F%2Fcom.microsoft.mytestiosapp

Is there config in the Azure portal that is missing which allows non-HTTP redirect URLs? Is this a bug in the ADALiOS library?

Also, where does the encoded Redirect URI need to be registered? In the iOS app's .plist? In the Azure portal? Both?

You must be trying to register the app as a Web Application. You need to create a new application in the directory as a Native Client Application :

本机客户端应用程序

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM