Security :: Override The XmlSiteMapProvider And Add An Attribute Indicating Which Role Provider To Use?
Jan 27, 2011
I was hoping some of you would entertain my XmlSiteMapProvider question. I have a portal site that has multiple ASP.NET Role Providers. One for each child web application. I need to basically change the role provider on the fly. Does anyone know if this is possible? My approach is to maybe override the XmlSiteMapProvider and add an attribute indicating which Role Provider to use. Then, in the
IsAccessibleToUser method, I was planning on dynamically change the role provider some how based off the new attribute.
Again, is this approach seem reasonable/doable or am I in the weeds here? I'm open to alternatives if anyone has one.
View 1 Replies
Similar Messages:
Jul 27, 2010
I am trying to build an application that
1. user can login by their AD account and password.
2. AD account can be assigned to different group.
I know there is a training video - [URL] to teach how to use the tool to provision the membership schema to SQL server for Forms authentication. but how can I use AD authentication with this?
View 1 Replies
Dec 1, 2010
i have implemented custom role provider and membership provider .
login page : SignIn.aspx
on successful login it redirects to (index-Homepage.aspx)
now PROBLEM is when it successfully logged in ,and redirects to 'index-Homepage.aspx' it gives Anornymoustemplate ..while its verifying the role correctly in index-Homepage.aspx.cs
View 1 Replies
Dec 1, 2010
1 - whats the difference between Role Provider and Membership provider ??
2- If we implement Custom Role Provider or Custom Membership provider then what does this means ? and which Provider do we use when we apply custom role provider or custom membership provider
View 4 Replies
Mar 18, 2011
Why asp.net sql role provider does not allow to update the role name , whats its reasons.
View 5 Replies
May 22, 2010
I roll my own SiteMapProvider inheriting System.Web.XmlSiteMapProvider.I want to override logic of checking user to be in a role specified in siteMapNode's property roles:
<siteMapNode url="Add.aspx?type=user" title="Add user" roles="admin" />
How can I do that? Which class's member does XmlSiteMapProvider call to check that if securityTrimmingEnabled="true"?
View 2 Replies
Apr 29, 2010
Is it possible to extend role provider? like instead of IsUserInRole(username, rolename) can we have a IsUserInRoleFacility(username, rolename, facilityid)
View 2 Replies
Oct 26, 2010
This is probably a lame question, but I know little of web development. I inherited a web project that I'm trying to get running locally. I get the mentioned error on line 46.
Line 44: </authentication>
Line 45: <membership defaultProvider="AD_MyCompanyName" />
Line 46: <roleManager enabled="true" defaultProvider="ADRP_MyCompanyName_Readonly" cacheRolesInCookie="true" cookieName="MyCompanyName.ROLES" createPersistentCookie="true" cookieSlidingExpiration="true" cookieTimeout="240" />
Line 47: <profile enabled="false"/>
Line 48: <customErrors mode="Off"/>
This code works on the old developer's box, but not on mine. I've been working through some TFS checkout issues on his box, assuming it was simply files left checked out. I can't figure out where the providers are added. I don't see them being added in the config file above. In fact, if I search for "AD_MyCompanyName" and "ADRP_MyCompanyName_Readonly", I get no hits in the entire solution. I can't figure out what they are. Not sure why it works on that box if I can't even find the providers being added.
View 2 Replies
Jul 24, 2010
I started out with the following code which worked fine, no problems:
[Code]....
I've since expanded the above so that it uses different providers according to the current logged in user. Here's the code since my changes:
[Code]....
I'm not getting any error messages but when I view the web page in the browser, it is stuck in a continuous loop where the page displays (correctly), then posts back to the server and displays again.
View 1 Replies
Apr 20, 2010
We are trying to implement Custom Role membership provider for our web app. For authorization we want to check for one more field like Facilityid for the logged on user along with role he has. eg. my User1 having Role1 with Facility1 can access some option and same user role for Facility2 have different option. So is there a way we can extend the existing role/profile provider to authorize user with this additional field along with role assigned.
View 1 Replies
May 26, 2010
I have a custom role provider and I'm trying to get the IsUserInRole() method to get called when a user of a certain role tries to access a restricted page. However, the method is never called.
[code]...
When the user goes to a restricted page, I'd like the custom role provider to check the user's role and deny/grant access.
View 3 Replies
May 12, 2010
I have created custome Membership Role and Profile provider using INGRES db. Now I can see my IngresMembership and IngresRole provider in the Provider tab(Select a different provider for each feature (advanced) ) of WSAT but when I clik on security tab I get this error:
"There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: Object reference not set to an instance of an object."
What am I missing? Do I need to add code for all override methods for Role provider? I have just written code for the Initialize and GetRolesForUser functions.
View 1 Replies
Feb 9, 2010
I have a custom role provider class that is currently being used by a web application. We are now in the process of migrating several windows applications from VB6 to VB.Net. From preliminary research, I understand that I can use the custom role provider in win forms as well and came across Client Application Services. I understand how the Client Application Services is setup, but can't seem to find how the custom role provider code will be shared between the web apps and the windows apps.
View 3 Replies
Jul 28, 2010
I'm building an application that will be used by a number of different schools who want completely separate databases so I've decided to have multiple connection strings and membership/role providers in my web.config file. In my code, I'm trying to set which connection string and provider to use at runtime for the correct database according to the logged in user.
I'm coming into a lot of bits in my code that previously worked fine, that now don't. For example, I used to use:
[Code]....
But now that I've changed it to this, it doesn't work anymore:
[Code]....
The compiler tells me that AddUserToRole is not a member of 'r'. I've had similar problems not just with Roles but Membership too, like with calling CreateUser.
I'd still like to be able to use all these methods that I was using before which are extremely handy. I just want to be able to set the membership/role provider at runtime rather than use the default one. Am I doing something wrong? Is there a simpler way to go about this?
View 7 Replies
Feb 21, 2010
I've just started a small ASP.NET web application. In this project, I need to authenticate the users with Active Driectory. I managed to authenticate the users successfully with Active Directory. But with Authorization with Custom Role Provider, I'm so confused.You see, the user name and password are stored in AD. So, my approach is that after the LoggedIn event of the Login Control, I check if UserName is not yet stored in the Users table yet, then I will store the UserName there. Eventually, I have all the UserName of the AD users store in the Users table so I can assign Roles to the users.
Let's say I assigned UserA to RoleOne. After he logs in successfully, I do some query to look for his Roles.
Where do I keep the Role ticket? In the Cookie or in the session? How does the authorization of ASP.NET role provider work? I want to store the authentication ticket like ASP.NET role prover does too.
View 1 Replies
Feb 15, 2011
I have a web app developed using role & membership provider...
this is my web.config file
<authentication mode="Forms">
<forms loginUrl="Forms/LogIn.aspx" name=".ASPXFORMSAUTH" defaultUrl="Forms/main.aspx" timeout="30"></forms>
</authentication>[code]....
So i would like that the page "pag1.aspx" is reached bypassing the "main.aspx" so If I try to digit directly on the server http://localhost/forms/pag1.aspx?C=159 ......correctly appears the login page....and the URL became..
http://localhost/Forms/LogIn.aspx?ReturnUrl=%2fForms%2fpag1.aspx%3fC%3d151&C=159 and after login I can see correctly the page1.aspx . when I try to reach the page from my browser..I digit
http://myserver/forms/pag1.aspx?C=159 .... the login page appears...but the url became..
http://myserver/Forms/main.aspx
and after login I cannot see the page1.aspx....but main.aspx
View 1 Replies
Feb 5, 2010
I have a custom oledb role provider that pretty much a cust and past of:
[URL]
except I've used oledb instead of odbc. I'm connecting to an oracle database and the tables have been created with out any issues. now if I go into the Website Administration Tool and try to create a new role I get the error
"Specified cast is not valid."
I can create a role directly in the database (through TOAD) and the role will show up in the .NET WAT, so I know it can make the connection and read the info just fine. I just can't create or delete or modify a role without the above error.
I'm using C# in VS 2008 Pro.
My provider code is as follows:
[Code]....
View 1 Replies
Aug 10, 2010
Can somone help me with this error?
Configuration Error
Description:
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.Parser Error Message: Default Role Provider could not be found.Source Error:
[Code]....
Source File: C:inetpubReaganweb.config Line: 43 Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 here is my web.config code for the provider
[Code]....
View 3 Replies
Aug 17, 2010
I want to execute some logic if the Logged in User can view a page "~/MyPage.aspx". IF the logged in user should be elligible to view the page is determined by the role based security I configured in the web.config file. There are many methods to find out if the user is in role XXX or not. But I did not find any method to find out if the user can view a page or not ahead of transferring the user to that page. Maybe I will hide a link to a specific page to the logged in user if the user is not elligible to view that page if I know the technique i am asking here to know.
View 1 Replies
Apr 4, 2011
There are multiple roles. (Role A, Role B etc) There are multiple input/output fields. (Field A, Field B etc) There are multiple permission levels controlling access to each field. (Read, Direct Edit, Edit With Approval, None) Each role has its own permissions to fields. (Role A has Read Permission to Field A; Role B has Direct Edit permission to Field A etc) Every role can be assigned to users and they are assigned by Geographic information. (User A is assigned to Role A for Continent: Europe - Country: Germany; User B is assigned to Role A for Continent: Europe - Country: France; User A is assigned to Role B for Continent: Europe - Country: France etc) Users can have multiple roles User identity is coming from Windows Authentication.
is it possible to represent this type of kind of multi-layered security model using ASP.NET internal membership/role providers? If so, what should my starting point be? Creating only custom role provider with custom methods and fields be enough?
View 3 Replies
May 26, 2010
I am trying to create a Forms Authenticated site and have already used the aspnet_regsql tool to create the necessary logic in my SQL Server DB to hold my data. Now, I am looking to create a custom Membership, User and Role provider for my DB model. I was looking at the following video: [URL]
Now, I get the concept on how to go about it but I notice that this guy uses custom DB Procedures as to the ones that are generated by the aspnet_regsql tool. Can anyone direct me on where I can find info on how to go about building the Membership, User and Role provider class using the DB structure that aspnet_regsql generates? So much junk on google that I am having a hard time finding good guidance.
View 1 Replies
Feb 18, 2011
I am creating a interface for User Role Management based on built in membership provider.I want to display all the roles as check boxes for a selected user. I am able to display all the roles in the database, but not able to load the specific user roles. For example, I am able to publish role 1 role 2 role3 role 4 as check boxes. But if the user is already flagged as role 1 and role 3, I am not able to show that data (role1 and 3 should be checked when form loads, but right now, they are not checked)...How do I get the roles as checked boxes display on a page.I am using a repeater control to display roles as check boxes on the page..
<asp:Repeater ID="UsersRoleList" runat="server">
<ItemTemplate>
<asp:CheckBox runat="server" ID="RoleCheckBox" AutoPostBack="true" Text='<%# Container.DataItem %>'
[code]...
View 1 Replies
Sep 27, 2010
I have watched the how to video on Creating a Custom Membership provider. So far it works great. My login control interacts well with it etc. Now i've created a Custom Role Provider. I've created a class that inherits the RoleProvider base class and i've added code to each Sub. My question is, what is the best way to implement the role provider, considering I get the Roles etc from the database?
View 11 Replies
Jan 4, 2011
1. Why we need override the methods? (i know what is ovwrriding but why ?)I gave answer to extend the functionality of method is it right ? again sub question was ,
Class A
{
method1()[code]....
if i can create the object of Class A in class B and can invok the method then why need to override metho here ? in fact i could not get this question , because i think both concept are irrelevat with each other. why he asked this ?same for overloading.
why we need overloading?If MSIL is there then what is need of CLS(common language runtime ) and CTS(common type system)List the 5 resposibilities of CLR (I explained only CTS,CLS,Garbage collection) was i right . what else?
What is role of abstraction and encapsulation? what the difference between them ? In which situation we have to devlop abstration and encapsulation.
6.What is included in signatures , when we said overloading means same name but different in signature. Is access modifiers included?
7.What is asp.net application life cycle?
8.Let say I am requesting for web application first time (genuine first time), how the request will executes? how IIS will know that for which application is this request is ?
9.If interfaces have empty methods (implicit abstract method) then what is its need? why we say it is reduces the code and provide reusability ?
10.In which scenario we need to implement interfaces?
11.In which circumstances we need to develop abstract classes?
12.Is class is static, means we can not create its instance, we can not derive it then how can we use method containing it? Why we need static classes?
Please guide me about these all question
13 What are the http handlers. http modules? who handle the request and resposes? why need of httpcontext ? what are the limitations of http handler, httprequest, httpcontext, httpresponse.
View 4 Replies
May 13, 2010
I'm trying to override the UniqueID attribute of an HtmlInputRadioButton. I'm extending the HtmlInputRadioButton class and using the code below:
[Code]....
But the rendered radio button tag looks like this:
[code]....
View 1 Replies