I am using a External Authentication System that returns to me the current logged on user (Please do not ask why or if I can use the stuff built into ASP .NET or AD because these are not a option).
What I would like to do is given that I trust the information provided by from the external authentication system I would like to be able to use it in the Roles Manager.
I want to define a few roles and then add users to them (using the user names provided by the external authentication system) as a string. Given that I want to get the roles that the user is in from the roles manager. The goal is to control the portions
of a web page that are visible based on the role a user is in.
For example given this type of page I want to be able to have a person in the administrator role get Munu Items A,B,C and and a custormer role to get Menu Items Q,R,S.
wtholmes
Member
1 Points
6 Posts
Using an External Source for current user in Roles Manager.
Jun 22, 2012 04:15 PM|LINK
Hello,
I am using a External Authentication System that returns to me the current logged on user (Please do not ask why or if I can use the stuff built into ASP .NET or AD because these are not a option).
What I would like to do is given that I trust the information provided by from the external authentication system I would like to be able to use it in the Roles Manager.
I want to define a few roles and then add users to them (using the user names provided by the external authentication system) as a string. Given that I want to get the roles that the user is in from the roles manager. The goal is to control the portions of a web page that are visible based on the role a user is in.
For example given this type of page I want to be able to have a person in the administrator role get Munu Items A,B,C and and a custormer role to get Menu Items Q,R,S.
Thanks
Bill
<asp:LoginView ID="LoginView1" runat="server"> <RoleGroups> <asp:RoleGroup Roles="administrator"> <ContentTemplate> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal" ItemWrap="True"> <Items> <asp:MenuItem NavigateUrl="~/a.aspx" Text="A" /> <asp:MenuItem NavigateUrl="~/b.aspx" Text="B" /> <asp:MenuItem NavigateUrl="~/c.aspx" Text="C" /> </Items> </asp:Menu> </ContentTemplate> </asp:RoleGroup> <asp:RoleGroup Roles="customer"> <ContentTemplate> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"> <Items> <asp:MenuItem NavigateUrl="~/q.aspx" Text="Q" /> <asp:MenuItem NavigateUrl="~/r.aspx" Text="R" /> <asp:MenuItem NavigateUrl="~/s.aspx" Text="S" /> </Items> </asp:Menu> </ContentTemplate> </asp:RoleGroup> </RoleGroups> </asp:LoginView>BrockAllen
All-Star
27434 Points
4891 Posts
MVP
Re: Using an External Source for current user in Roles Manager.
Jun 22, 2012 05:08 PM|LINK
I can't tell if your roles are stored in a custom database (or in this external system), but you don't have to use the role manager/role provider to load roles for a user.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
wtholmes
Member
1 Points
6 Posts
Re: Using an External Source for current user in Roles Manager.
Jun 29, 2012 08:34 PM|LINK
Hi,
Thanks for the bread crumbs. With this information I was able to find what I need and got this working.
Bill