How do I integrate Auth0 into a Firefox Extension?

Thanks to the Auth0 community, I have integrated Auth0 successfully into my Chrome Extension. I am now trying to port my extension to Firefox and I cannot find a single piece of info on how to do that. It almost just works out of the box with the Auth0Chrome library, but fails because I don’t know what to set as the Allowed Origin in the Auth0 Application settings. For chrome, I need to put:

chrome-extension://myappid

But I just don’t know what the equivalent of that would be for Firefox.

2 Likes

Hey @jaradd!

Great that you’ve managed to integrate Auth0 into your Chrome extension. As you’ve probably seen we only provide tutorial for making such extension in Chrome. Unfortunately we do not have one in Firefox.

While maybe someone from our community will be able to guide you somehow, I highly suggest reporting this as feedback to our feedback team so that we can add it to our product roadmap so as to make other developers’ implementations in the future easier.

Here’s the link to feedback page: Auth0: Secure access for everyone. But not just anyone.

1 Like

If at some point someone suggest you a solution to this case or you will find it yourself, please post it in this thread so we can redirect other community members wondering how to do that here.

Thanks a lot!

So I finally managed to get it working after a lot of trial and error. The Auth0Chrome library will work with Firefox since they both support the launchWebAuthFlow method. The tricky part was configuring the Auth0 origin and callback url settings. For the Allowed Origin, you need to input the firefox manifest url which you can find in the Firefox add-on settings. It will look something like this:

moz-extension://ab45b337-23fe-41f0-8dc6-fbc05115b6b6/manifest.json

For the Allowed Callback, you need to put the url that Firefox will tell you is missing when you try to auth without it. I stuck the auth0 at the end because that’s what it appeared you had to do with the chrome extension. It will look something like this:

https://5c3b0a52b73facd5a864213b2a33a903eb008c73.extensions.allizom.org/auth0

2 Likes

Super! Great to hear that you’ve managed to do that! I’ve marked your answer as a solution to this thread.

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