简体   繁体   中英

What OAuth 2.0 Redirect URI do we use for Cordova iOS/Android mobile applications?

We're using Cordova to convert our HTML, JS, and CSS web app to deploy to iOS and Android. We're attempting to implement OAuth 2.0 and OpenID Connect using Azure Active Directory (MSAL.js) into the application. Our redirect URI will not take us back to the mobile app on the device.

The redirect_uri that we're using "msauth.org.businessname.appname://auth" which is created by the Platform configurations for iOS on Microsoft Azure > App Registrations > APP > Authentication: Redirect URLs section (new experience).

We've attempted updating the iOS Custom URL Scheme ( https://coderwall.com/p/mtjaeq/ios-custom-url-scheme ) to point to "msauth.org.businessname.appname://auth".

RedirectUri = "msauth.org.businessname.appname://auth"

We expect the mobile application to shell out to the browser for the user to enter their credentials and consent. Then the web site will redirect the user to their mobile application.

Check out this plugin: https://www.npmjs.com/package/cordova-plugin-customurlscheme?activeTab=readme . You add a url scheme when adding the plugin and then you can grab the redirect url (containing the token(s) that you need) using the handleOpenURL() function after the user authenticates. This is all very well documented in the README of the project.

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