Azure AD Redirect URI Issue for iOS with Ionic: AADSTS50011 Error

Hi,

I have an SSO app registered in Azure AD. The ionic-angular app works correctly on Android and desktop web platforms. However, I encounter an error when using the iOS app:

AADSTS50011: The redirect URI ionic://localhost/ specified in the request does not match the redirect URIs configured for the application.

This issue is specific to iOS. The redirect URI used is ionic://localhost/ (or capacitor://localhost when using Capacitor), as described in the Ionic documentation.

Unfortunately, Azure AD does not allow registering ionic://localhost/ as a valid redirect URI, since it only accepts URIs that begin with https:// or http://localhost. Redirect URI (reply URL) best practices and limitations - Microsoft identity platform | Microsoft Learn

Is there any supported way to change ionic://localhost or capacitor://localhost to use http://localhost on iOS?

Thank you!

iOS doesn’t allow http / https. From the Config docs under server.iosScheme:

Can’t be set to schemes that the WKWebView already handles, such as http or https setURLSchemeHandler(_:forURLScheme:) | Apple Developer Documentation

You should be able to use a Deep Link - Deep Links | Capacitor Documentation

1 Like