Multiple applications with single user login

I need a clarification. I need to use anvil like following.
I need to create multiple apps and share it to my user for every apps I need to create user login permissions and lot of things. But here I just need a clarification, for those multiple apps i need to have to have only single login page, so that user can access multiple apps with the single login. and i need to allow him to use only certain apps like if i have 10 apps for user 1 i need to access to only 5 apps and for user 2 I need to give access all apps. Is that things are possible?.

All of that is possible. There are two main mechanisms I know of for having multiple apps share logins.

One is in the configuration of the Users service, in the Login Options section. There’s a checkbox there that allows the app to share its login status with other apps that share the same Users table. Using that any apps that share the same Users table would share the same login status.

The other is to have a single app and partition it based on hash urls. This works when all the apps are part of a single domain. In this case you have one Anvil app and multiple pseudo-apps inside it.

Granting access to only certain apps is the same for both methods, have data in your tables that tells you which apps a user should be able to access. If they don’t have access to a certain app, they’d be able to login but have no other functionality available.

4 Likes

Thanks jshaffstall. :heart:
Okay seems like you got my point. Is there is any references to do that.

It depends on which method you’re going with.

If the first, the docs contain information on sharing tables between apps (note that sharing tables is not supported in the Beta editor, you have to go back to the classic editor to share the tables). What I described in the paragraph above is enough to configure the Users service.

If the second, search in the forum for hash routing. There’s an excellent module in Anvil Extras that will take care of the routing for you.

With either approach, play around and create a couple proof of concept apps to get the techniques right, and ask back here when you have issues.

2 Likes