My first post here and a particularly tricky one from what I can figure out.
Basically I have a new Ionic 5 app, using the auth0/auth0-angular library in order to perform authorisation,
Now this works absolutely fine on web.
The issue comes on mobile build of the ionic app.
We are using Capacitor to do this.
The app loads, opens safari displaying the login page. It is important to point out here that this is the safari app itself, not an in-app browser.
I successfully login and I am presented with the popup (Open in AppName )
I click Open and am directed back to the application.
At this point however my app just freezes on a black screen.
The callback and redirect don’t seem to happen at all.
My iOS logs just say APP ACTIVE.
Been at a loss for about a week now.
Any help or bright ideas would be wonderful.
@CHAZTATS - Can you explain how you got the Auth0 client out of the Auth0 angular SDK? I don’t see that exposed in the SDK at all, yet I see you have it in your code snippet.
this.auth0Client.handleRedirectCallback(url)
I see the Auth0 Client is exposed more in the Auth0 SPA SDK, but it seems to be encapsulated in the Angular SDK from what I can tell.
Hey guys, apologies, I no longer work at the place where I implemented this so don’t have access to the whole codebase anymore, but I’ll try help as mush as I can.
So when I did it I actually pulled the angular sdk as a project and imported it locally into my app.
That way I could make changes directly to their auth.service.ts.
So when I added the above code snippet, it was added directly into that file.
I was able to get a flavor of this to work on Android. I’ll have to wait a bit to do the iOS test (no Mac with me).
@CHAZTATS - do you recall if your solution was able to open the Auth0 window in-app, or if it was an external browser to the app? I’ve been able to open the login window in-app, but I get a variety of Auth0 issues when attempting that. It seems like it should be possible though.
@CHAZTATS - I found a solution to keep the login in the same window. The Capacitor Browser import approach has a very strange syntx that I’m not used to. Once I got that right, using the Capacitor browser plugin seemed to work well. Some snippets below for reference.