I’m a beginner in Ionic and would like to ask if Ionic can handle authentication on custom/external web page that uses Oauth (This page is NOT Google, Facebook or other popular sites). If login is successful, it will be redirected to Callback URL. This seems fine on web applications, not sure if it’s possible on mobile app though.
For the mobile app, what I would like to achieve is:
Display the external Login page on mobile screen.
User will enter user name and password and follow the authentication process.
The external Login page includes allowing some permissions, 2-factor authentication, etc which the user needs to perform to proceed.
Once above steps are successful, it will be redirected to Callback URL (not yet created). This step can be skipped and immediately redirected to next step.
After user is successfully authenticated, screen in the mobile app will be redirected to home page created in Ionic.
Questions:
Is it possible to display the login page inside Ionic content?
How to handle call back in Ionic so it will display home page after successful authentication?
The code I posted isn’t going to work for your particular use case, it’s just supposed to give you an idea of the approach, which is basically: launch an InAppBrowser, listen for URL changes.
This code is designed specifically for using the InAppBrowser plugin on a real device, not for running through a normal desktop browser. It’s also been a while since I’ve used it so the InAppBrowser API may have changed since then.