3

I'm working on a project which is a mobile application developed with Ionic. The project is split into two parts: a mobile front-end and a back-end. The back-end is performing all the calls to external services and applying business rules, while the front-end only calls my back-end.

One of the services I'm using is a IAM service using Oauth2 protocol. I've implemented the authorization code flow to integrate this service. Until now, I was always using the command ionic serve to run my front-end in a web browser, and everything is going well.

But now, for testing purposes, I need to run my front-end in an android emulator. In order for my front-end to contact my back-end, I'm using the IP 10.0.2.2 (which is the alias of the loopback of my machine where my back-end is running).

The problem is with the redirect of the authentication service. It is not something that I have control on, and it can take weeks or months for the service provider to update my client configuration. When I want to authenticate myself through the app running on emulator, it opens a InAppBrowser to perform the authentication. When I successfully authenticated myself against the service, the redirect URI is http://127.0.0.1:8080/xxxx, and this response is sent to that InAppBrowser.

My question is: Is there a way to replace the base URL of that response (without changing the client configuration), so that I can send the call response to my back-end ?

NOTE: I've been trying to find a solution online, but I can't find anything on that topic. I suspect that in that matter, I probably lack some vocabulary in order to find what I'm looking for. Is there a way to

Nicolas G. Duvivier
  • 498
  • 1
  • 6
  • 18
  • @paulsm4 Thanks for the suggestion. After reading the thread and linked questions, it doesn't seem to help for my problem. – Nicolas G. Duvivier Oct 02 '19 at 17:25
  • Suggestion: look at these links: [Ionic forum: OAuth what would the Redirect URL be](https://forum.ionicframework.com/t/oauth-what-would-the-redirect-url-be/117165/3), or [Stack Overflow: Failing to retrieve OAuth 2.0 access token on android emulator](https://stackoverflow.com/questions/35732242/) – paulsm4 Oct 02 '19 at 17:26

0 Answers0