question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for multiple Auth0 tenants

See original GitHub issue

Before version 2.9, we were able to add support for multiple tenants (for example, we have a dev tenant and a prod tenant) by simply adding multiple <data/> tags to the intent filter, one for each auth0 domain we use. With the updates in version 2.9, we can only specify one Auth0 domain. We can swap between Auth0 domains between doing production builds and dev builds, but in our use case, our team needs to be able to swap between dev & prod servers at runtime (which worked with multiple data tags).

Don’t know enough about Android/Gradle to know the limitations of manifestPlaceholders, but it doesn’t seem like having list-type placeholders that generate tags would be possible. Another solution would be to have option to specify the intent filter in the user’s AndroidManifest, like how it was done pre-v2.9 (not sure if there’s already a way to override the react-native-auth0’s AndroidManifest)

Was able to get around this by adding multiple <data> tags to the intent filter inside of node_modules/react-native-auth0, and add corresponding manifestPlaceholders (e.g. auth0Domain_prod and auth0Domain_dev) but obviously this is not a real solution.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
naajawcommented, Nov 15, 2021

@Widcket adding an activity with tools:node="replace" seemed to work! thanks!! for the sake of writing out a solution on this thread, I added this to my AndroidManifest:

<activity android:name="com.auth0.react.RedirectActivity"
          tools:node="replace">
    <intent-filter android:autoVerify="true"
                   tools:targetApi="m">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:host="domain1.auth0.com"
              android:pathPrefix="/android/${applicationId}/callback"
              android:scheme="${auth0Scheme}" />
        <data android:host="domain2.auth0.com"
              android:pathPrefix="/android/${applicationId}/callback"
              android:scheme="${auth0Scheme}" />
    </intent-filter>
</activity>

(which is identical to the <activity/> tag in the package manifest, with the exception of explicitly defining multiple domains and adding the tools:node="replace") and remember to add xmlns:tools="http://schemas.android.com/tools" to the topmost <manifest/> tag

2reactions
xanderdeseyncommented, Oct 21, 2021

This is completely blocking our team from upgrading as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-Tenant Applications Best Practices - Auth0
You can represent each of your tenants with a separate Auth0 tenant. This approach allows you to share access to the Auth0 Dashboard...
Read more >
Create Multiple Tenants - Auth0
Go to the Auth0 Dashboard, select your tenant name, and select Create Tenant. Dashboard Tenant Drop-Down Menu Create Tenant · Enter your desired...
Read more >
Link Multiple Tenants to a Single Subscription - Auth0
Auth0 offers the ability for customers with an Enterprise subscription to link multiple tenants under a single Auth0 subscription (these linked tenants can ......
Read more >
How to Use Auth0 for B2B Multi/Single-Tenant SaaS Solutions
TL;DR: In this article, you will learn how Auth0 can support several configurations for single and multi-tenant applications.
Read more >
Set Up Multiple Environments - Auth0
Development, staging, and production environments are easy to set up in Auth0. Simply create a new tenant for each environment to guarantee isolation ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found