Integrate Auth0 into ionic app

Hello, I am stuck on this issue since last three weeks now. I am creating an Ionic application which will be deployed as a pwa web app and android/ios. I want to integrate auth0 in such a way that my single codebase can work for all platforms.
I have tried normal implementation like angular project using auth0-js and auth0-lock and it works fine for my pwa web app, but doesn’t work for my android app.
I have also tried implementing solution given in docs: https://auth0.com/docs/quickstart/native/ionic4
and it works fine on android. But it gives me error of “isAvailable” on web.
How can I make the Auth0 Login available in web mode without getting the Cannot read property ‘isAvailable’ error?

Can I use auth0-js and auth0-lock at the same time for my native app? Does auth0 has support of capacitor of ionic? Is there any way in which I can deploy my applications on all platforms with a single codebase?

Good afternoon @divyasmehta, welcome to the Auth0 Community!

I wanted to reach out and let you know I am looking into this. When you get a chance can you please direct message me your tenant? Thanks in advance!

Were you able to find anything ? @James.Morrison

I need more details on the situation. I would be willing to dive into the specific instance you are experiencing but I need the tenant name for that. Please direct message me with any details that can help us in the investigation. Thanks in advance.

Touching base on this front @divyasmehta to see if it’s a public repo or private?

Can you share more details directly related to this error?

There really shouldn’t be a need unless you feel like you’re missing something? If so, please share with us so we can better understand.

I’m tired of simply speculating to myself… I want to ask explicitly. For Capacitor/Ionic ecosystem It seems that Auth has been adopted as a core business model for integrating things like Auth0 via the $25k pricetag on AuthConnect.

I was not subsequently surprised to find it is very difficult to integrate Auth0 into a modern Capacitor 5 app (no accident I would imagine). After spinning my wheels (about 3 weeks for me as well) and much smashing of skull against wall I abandoned Auth0 and had a solution within 30 min using free plugins like https://github.com/CodetrixStudio/CapacitorGoogleAuth and https://github.com/rdlabo-team/capacitor-facebook-login

Explicitly - Is it a deliberate design decision to make using Auth0 in a Capacitor app on mobile extremely difficult?

@James.Morrison

1 Like

@NathanArgy thank you for bringing this to my attention, let me look into this and see what feedback I can gather from our teams. Thank you for your patience.

I’m sorry you didn’t have a good experience when working through these challenges and it’s not done on purpose in the slightest. It would make me happy if we could work together on compiling a list of the challenges you faced as mentioned in the your other created topic, I hope to make this a more streamlined and documented experience.

I have followed this documentation, and it says that this plugin can be used in native app only and will give error on web: https://auth0.com/docs/quickstart/native/ionic4?_ga=2.51263721.1174723799.1592835652-1492564585.1592835652#cannot-read-property-isavailable-of-undefined

My repo is private.

Hi @James.Morrison, we’re building a Capacitor/Ionic app right now and intending to integrate auth0 … are we heading for trouble? We’re still early in the development … but auth0 is already set in stone … should we be reconsidering Capacitor? Appreciate any insights you may have, thanks.

Can you share any more details in regards to the error you are experiencing? Logs or screenshots could help us discover more about the situation.

Hey @Peter.B, not that I am directly aware of. I am in the process of building a sample out leveraging the same stack so if I run into any challenges I will be sure to throw a flag on it. As you move forward please share feedback

Thanks Jim, good to hear, will let you know how it goes and share any challenges as we go.

2 Likes

Embarrassed to say I didn’t find this issue and raised this. We decided to use Cordova as thought would work better with Auth0, but still have not found a solution

I’ll be looking again today, but atm, I can’t something that works with Auth0 & Ionic in a webapp and a mobile app in cordova or capacitor. Like everyone else, AuthConnect is not a sensible option due to pricing.

1 Like

Even I didn’t find any solution. Thus I have created two separate codebases for web and mobile for auth0’s implementation.

Also it is very frustrating that I am getting this error in android application also. Though it appears sometimes, but I have to uninstall app and install agian.

Thank you for sharing the challenges you are currently facing @divyasmehta. When you get a chance can you DM me the tenant being leveraged and app names that are being used so I can look into this? I assume the repos are private correct? Thanks in advance!

yes my repos are private. I have used Native client in auth0 for my ionic application.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.