Using Two Security Providers at Login

My app has users who can assign other users to their account. Each user with a login is a user, but several users may have access to the same set of data, defined by a field called subscriber_user.

Hence a user has an id field which is their user id, and a subscriber_user field which defines the set of data they have access to.

So…

When a user logs in, I want to capture in a Security Provider step, both the user id and the subscriber_user id. I’m doing this with two Security Provider steps as shown below… but the subscriber_user identity isn’t containing the right value. (well actually I’ve no idea how to see the value it contains, but it isn’t working correctly when I try to use it to search for data!).

Can someone please tell me how to achieve what I require?

Thanks!

Antony.

888888888888888888888888888888888888888888888888888

steps

888888888888888888888888888888888888888888888888888

user

888888888888888888888888888888888888888888888888888

s_user

Interesting. I’ve always set a session variable (instance in my case) that gets added to queries.

It doesn’t show in your pic, but are you doing two login actions, one for each provider?

Hello,
you don’t need two different Security Providers.
Try something like the following.

All users are users. I mean you will have one table that will hold all users and the user_id will always be unique.
For users that depend on other users, you will use another column which will be holding the user_id that the current user depends on.

On sucessfull log_in you will be getting current_user data.

I have a small tutorial that comes from the DMX databings era (but the Server Connect logic is the same). Below is the link

Hey Ken and Nikolaos…

Thanks for your input!

Ken, that is a brilliant suggestion, yes, adding a second login action for subscriber_user works!

Seems much easier than using session variables… the data I work with is either identified by user id or subscriber user id so the way to get that information is consistent and flows well in the Server Action gui.

All the pieces are coming together now!

Best wishes,
Antony.