Issue
We have a web app with ADFS/GoogleId login workflow implemented with redirects. Our app redirects to an ADFS server which logs in or validates the user, then links back into our app. Is this achievable in Ionic/Capacitor? This page suggests that navigating away from your app should automatically pop in a browser, and this is the behaviour we see.
Is there some way of registering certain domains as 'part of' a Capacitor app, so we can navigate without leaving the webview? This would mean that a return url of the form 'http://localhost' (or 'capacitor://localhost' for ios) could work.
Alternatively, if the browser takes over for the adfs domain, how can I construct a link that points back into the Capacitor app?
Solution
You can allow navigation to certain urls by adding allowNavigation
inside the server
object on the capacitor.config.json file
"server": {
// Capacitor to open URLs belonging to these hosts inside its WebView.
"allowNavigation": [
"example.org",
"*.example.org",
"192.0.2.1"
]
}
https://capacitorjs.com/docs/config
Note that it’s not intended for use in production apps, shouldn’t be used for OAuth or any other external urls you don’t own.
Answered By - jcesarmobile
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.