Redirect back to the Ionic app

Hi all
I am working on a project using the BFF (backend for frontend). So for web application, it works pretty smoothly, we navigate the user to the auth server (just by using this.window.location.assign(...)) where the user enters his credentials, and after that, the auth server is navigated the user back to the application with added cookies (like Session and XSRF token).

We are using Ionic, like a wrapper, to have the possibility to create mobile builds for iOS and Android. When I tried to use the same approach(this.window.location.assign(...))), it just opened a browser. It navigated back to the browser (after login on the auth server) without navigation back to the application and without set up cookies to the application.

To communicate with backend we are using an Angular HTTPClient for web and mobile.

So, the question is. Is it possible to have the same approach for mobile apps as we do for simple web applications? I mean open the auth server, fill and submit the credentials, and navigate back to the app with set cookies.

You say you are using Ionic as a wrapper. You probably mean Capacitor? Are you just embedding your app from a public server in a Capacitor app, meaning loading all the assets from a public domain/server? Or are you building your app and shipping the assets in the native app (like a normal Capacitor app). Please explain a little more of what you are doing.

I wouldn’t recommend using cookies for auth. You can search these forums and you’ll find way more stories of issues than successes :upside_down_face: :sweat_smile:

Thank you, forgot to mention it.
Yes, we are using capacitor and use a standard building and development process like “ionic capacitor run ios --livereload --external” and etc. for build creation.
I saw some topics related to the cookies on the forum. But didn’t find a solution for my problem(