Ionic5 react capacitor quick start

Hello, i am new here, just created app and going to add auth0 there but the docs in quick start is about ionic4, I have no idea how I can use this tutorial (The Complete Guide to React User Authentication with Auth0 )in Ionic5 + react .
Any examples?
Thanks

3 Likes

Hey there!

Unfortunately at the moment we don’t have any guiding tutorials on how to integrate with Ionic5.

I agree with this need. It seems like there are many people on this forum looking for more current Auth0 guidance for Ionic 5, ideally using Capacitor. The Auth0 cordova plugin seems to be very stale, and it doesn’t seem to be heavily supported.

Can we use the SPA SDK for Capacitor apps (web + mobile)? If so, what are the suggested steps?

In terms of that, in order for our Product Team to see such interest coming from our community I highly encourage you to create a topic in our Feedback category providing the necessary context:

Hi,

I’m using Ionic 5 with cordova.

If you are willing to pay the ionic-team for an enterprise offering they have options that work well.
The plugin they offer is called Auth-Connect and it works with capacitor.

The problem with the auth0-cordova is that it doesn’t necessarily follow the login flow that uses refresh tokens. The refresh tokens gives the UX which appears to be logged in forever on the mobile, just like when you are using gmail or other apps. If this is a requirement then I would suggest using Auth-Connect because they handle the low-level stuff natively in android and ios when it comes to integrating with Auth0.

Else if you do not have this requirement and are ok with an experience that follows the web login flow without refresh tokens then Auth0 cordova/ SPA libraries are should be good.

So what I have describe above is the PKCE flow vs the Implicit Flow in a very general manner. Auth0 has good documentation on both flows, worth reading about by the way. Auth0 Cordova follows the implicit flow.In Auth-Connect you have the option to use either PKCE or Implicit flow.

I’m using Auth-Connect with PKCE.

Mohammad

1 Like

Thanks for sharing that experience here in the thread!

I believe this is a significant gap in the Auth0 documentation. A quickstart/guide for Capacitor would be really beneficial, and I’ve seen numerous posts asking for this in the forums. Here is a feedback post for this.

5 Likes

Thanks for doing that. Let’s wait and see how many people are interested in this and will upvote your feedback idea!

Hi,
Can you please prioritize to add a starter or a tutorial for Ionic 5 with Capacitor and Auth0?
It is very frustrating that there’s no sample code for such a popular use case. I am stuck and I may decide to leave Auth0 if I am not able to find a solution, sorry.

Hey there!

It would be great if you can create a topic and share all that in our feedback category. Thank you!