Implementing in-app oAuth flows with Ionic and Capacitor Browser

Are there any examples of Ionic apps that have implemented a “native” oAuth flow?

  • Click on login with X from the app
  • Open in-app browser
  • Login
  • Browser closes and user is logged in

I assumed this would be doable with the Capacitor Browser plugin, but it doesn’t seem possible to close the browser automatically once login has been completed which is a fairly important step.

I assume there must be a workaround that isn’t mentioned in the docs?

Is there a browser plugin that does allow closing the in-app browser from Android?

Any help would be greatly appreciated

So after some testing, I realised Capacitor Browser doesn’t share Cookies with the Native app, so it’s entirely useless in what I’m trying to do :sweat_smile:

There are oAuth providers, but my login’s use next-auth so I think I have to do this through some kind of browser… No clue how to get there.