views:

38

answers:

2

Setup:

  • Multiple web servers with synchronized forms authentication.
  • Multiple asp.net Applications running on these severs.

What's working:

  • SSO across all servers
  • Authorization using asp.net roles

What's not so good:

  • All roles are "global" - I have "admin-app1" and "admin-app2" etc.

Question:

I know this can be solved by defining different "ApplicationNames" for each of the different applications but what is the most easy way to compile a list of all the different applications a logged on user has a role in?

I would like to do something similar to:

CurrentUser.Applications()
to get a list of "all applications in which the current user has any role".

Up to now I have used

Roles.GetRolesForUser()
to compile the list not very elegant or scalable.

Using the SqlRoleProvider I can hack inte the DB to get the complete list of Applications and then compile an application list for the user by query the different application's role providers. My best shot so far but it doesn't feel like the best solution...

Any hints or comments?

BR, Jens

A: 

I think ApplicationName is for completely separating applications while using the same database. Are you sure you can link users in one application name to roles in another?

Your best bet is probably to keep the same application name and implement a custom role provider.

http://msdn.microsoft.com/en-us/library/8fw7xh74.aspx

Greg
I have already a custom role provider which works fine when the user gets down to the application level.I am looking for a way to present an "applications list" in a dashboard where the user can choose which application to start.
JensJ
+1  A: 

I have come to the conclusion that this cannot be done using the framework.

Anyone who tries to do something similar e.g. buiding a dashboard of all asp.net applications hosted has either to maintain the list of applications separately or hack into the sql tables if you are using the SqlRoleProvider .

Happy hacking!

/Jens

JensJ