Configuration :: Deploying Custom Membership And Role Providers Under IIS7
Jul 27, 2010
I have a custom membership provider and a custom role provider in a .NET assembly dll called Qws.Web. The full namespace path to the classes are Qws.Web.Providers.QwsMembershipProvider and Qws.Web.Providers.QwsRoleProvider They both inherit MembershipProvider and RoleProvider respectively When I include the assembly using a project reference in VS2010 it all works fine. The minute I publish the website and project to the staging server (using IIS7) i get the following error: Unable to find the requested .Net Framework Data Provider. It may not be installed. You can see the site at [URL] I've tried all of the usual stuff and been trawling the internet for the last two days.
1. The Qws.Web.dll file IS in the bin folder
2. My Web.Config file is below:
[Code]....
3. The providers are not in the GAC and not in the machine.config file as I only want them available for this site.
View 3 Replies
Similar Messages:
Mar 8, 2011
Unfortunately, all the examples for Forms Authentication Code Behind w/ Custom Role and Membership Providers I find online are written with a VB.NET code behind and I need a C# code behind. I need a codebehind that will do the following:
authenticate user upon login button click
if user active_flag=0 (false) OR password!=@password, display error: "Access Denied"
if user admin_flag=1 & active flag=1 (true), redirect to admin_pageszipsearch.aspx
if user admin_flag=0 (false) & active_flag=1 (true), redirect to pageszipsearch.aspx
Default.aspx Code:
<asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false">
<LayoutTemplate>
<span class="failureNotification">
<asp:Literal ID="FailureText" runat="server"></asp:Literal>
</span>......
View 1 Replies
May 19, 2010
As mentioned in subject line I'm not able to configure role based website in IIS7. Please find details below.
Environment Details:-
.Net Framework: 3.5
Server: Windows 2008
Webserver: IIS7
Database: SQL Server 2008
Authentication Type: Form Based
Roles/Membership Provider: User defnied.
Problem:-
After setuped my website in iis7 while trying to Login in web page even I entered correct password it says Incorrect password in Login control.After long googling I suspecty that we need to add "Provider to trusted provider" to Authorized provider. I have gone http://www.iis.net/ConfigReference/system.webServer/management/trustedProviders/add but didn't works for me.
Can you anyone please help me in this.
View 8 Replies
Mar 10, 2010
how do i do that through config file?
View 11 Replies
Oct 26, 2010
To begin with I work on the large application, that has a WinForms client and server. Server in our case is the set of WCF services. There is one service that is responsible for authentication of users. The logic of authentication is custom and complex and authentication service uses different membership providers.
We want to protect the access to server services for non-authenticated users. The users must firstly authenticate and than use other services (users in this case are the other systems, services, WinForms client, etc.). On this basis, we decided to use the ASP.NET Url/File Authorization feature.
So, I set on the ASP.NET compatibility mode, allowed cookie in all binding configurations, added AspNetCompatibilityRequirements attribute to our services and added the followingconfigurations to config:
<authentication mode="Forms">
<forms cookieless="UseCookies">
<credentials passwordFormat="Clear" />
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
...
<location path="AuthenticationService.svc">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
In the authenticate method of our authentication service I add the following code:
public AuthenticationResult AuthenticateUser(string username, string password)
{
AuthenticationResult result = new AuthenticationResult();
result = Authenticate(username, password);
if (result.IsAuthenticated)
FormsAuthentication.SetAuthCookie(username, true);
return result;
}
Next, I wrote the following code:
var authClient = new AuthenticationServiceClient();
var result = authClient.AuthenticateUser("user", "password");
var otherClient = new OtherServiceClient();
var temp = otherClient.DoSomething();
But after authentication I can't access to OtherServiceClient...
So, how can I share the call context between the WCF services calls? Could anybody provide some useful articles about this question?
View 1 Replies
Dec 9, 2010
so I have a fully functioning DynamicData website, and all works fine when debugging in VS2010But when I moved the site to a webserver (server 2008, IIS7) the default paeg comes up, but any links or pages after that are all sending 404 errors http://{IP address}/{table}/{action}.aspxdoes not work when on the server, but works fine in VS.What configuration am i missing from IIS7 to make this url work?
View 1 Replies
Aug 14, 2010
I have attempted to deploy my first WEB application and needed to include the Membership for Internet login. Application works fine when I use Visual Web Developer, but when I deploy to my provider when I attempt to Login, I eventually get the error message (this was after I turned on the debug="true" - full message is
[Code]....
When I copied the application to the WebSite, I assumed that the ASPNETDB.MDF needed to be copied too with everything that I defined for users and roles. Looked at the WEB.CONFIG and expected to see something defined here as to where it is located, etc. Do not see anything in my project with the name.
View 3 Replies
Aug 10, 2010
I'm about to roll out my web site soon, and was just wondering if there's a way to roll out the db I'm working with on my dev computer, or if I have to recreate everything on the production server. If I can roll out my dev db, will the uids be the same?
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
Oct 18, 2010
I have Membership configured with IIS7, tables for it located in my own database, created with aspnet_regsql utility, and I am using custom connection string to access it.
This is part of web.config related to Membership :
[code]...
View 2 Replies
Apr 26, 2010
I created a custom forms authentication and membership provider and it seems to work fine opening up in WAT, creating roles and adding users. Also when I in my mvc app use it to log users in, it works fine. However it seems to fail to determine a user's role (no errors, but just jump over User.IsInRole(...) lines and Roles.GetRolesForUser(); comes up empty. I got a gut feeling I did something wrong with my configuration, so for now I'll post just that:
[Code]....
View 6 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
Jun 11, 2010
I am developing an application in which I can connect to the ASPNETDB.MDF if it is on my machine, however, when I want to put it on another machine and try to remote connect it, I get the error:
An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.
Parameter name: connectionString and my connection string is as follows:
<add name ="NewRemoteSqlServer" connectionString="Data Source=P1M1_2-HPSQLEXPRESS; AttachDBFilename=C:ASPNETDB.MDF; Integrated Security=SSPI; Username=P1M1_2-HP; Password=plus1minus1; " providerName="System.Data.SqlClient"/>
View 5 Replies
Sep 10, 2010
Is it possible to hook multiple role providers with one service? I want client A to connect to service A with roleprovidername A & client B to connect to service A with roleprovidername B
View 3 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
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
Aug 11, 2010
Our site has got two ASP.NET membership providers. The built in one, and a custom one (SqlMembershipProvider.
I am able to log into both no problems, but I don't necessary require the ability to have both logged in at the same time.
The issue I have is as follows:
User "person_a@site.com" logs into the built in provider. They then navigate to the section of the site where we require the custom provider.
On this page, I can check if they are authenticated, and get their username. I can then get a MembershipUser object form the custom providers GetUser method. (HttpContext.Current.User.Identity.Name)
It is possible (and very likely) that the username "person_a@site.com" could also exist in the users for the custom provider.
But, I don't want them to be logged in here, as they haven't authenticated against the custom provider.
So, is it possible to check which proivider HttpContext.Current.User was generated from.
View 1 Replies
Jan 17, 2011
I have built two websites, both of them use a custom membership provider I have written myself.
One of these sites is already a long time online and runs fine. Now I have installed the other site on the same webserver in the same Web as a different application. Also have I given a seperate ApplicationPool for each solution.
If now the client logs on to one site, he looses the session on the other and vice versa. It's not possible to be loged on on both sites together. All the rest works fine.
What is the connection between the two sites. Is it necessary to change something in my membership providers?
View 1 Replies
Feb 18, 2011
I'm trying to use both the default Membership and Profile Providers and can not for the life of me get both to work at the same time. I'm using MS Visual Web Developer 2010 Express and when I create a new Project I get access to the Membership but not the Profile. When I create a new Website I get just the opposite i.e. access to Profile and not Membership. What do I need to do to get access to both?
View 2 Replies
Aug 25, 2010
Using the a Membership provider and the MVC framework, is it possible that routes are dynamically changed so that a already logged in user goes to his own page, rather than the default.
At the moment I go to the default. If the user is already logged in or not, there I do a redirect to their own page. This can't be the correct way! Can it?
In RegisterRoutes I have this
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute("Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
View 1 Replies
Apr 1, 2011
I know this question is asked (and answered) a lot already, but I believe my situation is unique.
We are using the ASP.NET SqlMembershipProvider. However, we also have some less-secure content we would like to secure by adding users directly to the web.config, like so...
<forms loginUrl="login.aspx" defaultUrl="default.aspx">
<credentials passwordFormat="Clear">
<user name="user1" password="123" />
<user name="user2" password="456" />
</credentials>
</forms>
Is it possible to use this method alongside a SQL Membership Provider? If so, how?
I know it's bad practice to do this. This is only a stepping stone as we move parts of our website into the asp.net application. We would like some of those password to be easily editable without going to the database.
View 2 Replies
Mar 22, 2010
I am writing a login routine that uses a .NET login control and I have a membership provider as well and set it all up in the config file. But I don't plan on using a connection string as I will be calling a web service in my ValidateUser function. Do I need the connection string in the config because it seems to throw an error if I don't have it.
In that case if you need it then wouldn't it be better to treat this membership provider class more as a normal class and just make calls to it directly like any class and not put any setting on my login control and remove the entry from my web.config
View 5 Replies
Feb 25, 2010
In my web application am using ASP.Net Membership for authentication ann role management.But now i have a situation where i need to authenticate multiple clients against different DB based upon the URL request being send. Below is my web.Config Details.
<authentication>
<forms loginUrl="Login.aspx" defaultUrl="Login.aspx" />
</authentication>
<membership defaultProvider="QuickStartMembershipSqlProvider">
<providers>
<clear/>
<add connectionStringName="MEMBERSHIP_AND_ROLES" minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="SecurityQuickStart"
requiresUniqueEmail="true" passwordFormat="Hashed" name="QuickStartMembershipSqlProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="QuickStartRoleManagerSqlProvider">
<providers>
<clear/>
<add connectionStringName="MEMBERSHIP_AND_ROLES" applicationName="SecurityQuickStart" name="QuickStartRoleManagerSqlProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
ConnectionString.Config:
<add name="MEMBERSHIP_AND_ROLES" connectionString="Data Source=x.x.x.x;Initial Catalog=xxx;User ID=xxx;Password=xxx" providerName="System.Data.SqlClient"/>
Am using form authentication for user authentication. In my login page am using Membership.ValidateUser(username,password),which is using default membership provider. Now my situation is i need to override the default DB and connect to multiple DB based on URL request send to my web server.
View 1 Replies
Apr 3, 2010
I'd like to know if its possible to use two membership providers within a single application. I need to have a membership provider "power users" and administrators on a site and a different one for clients and customers who will want to register on the site. I'd like to know if its possible to have two different membership providers to handle these two different sets of users. If it is, how do i go about it?
View 4 Replies
Mar 27, 2010
I'd like to know how membership providers works under the hood, if it uses cookies, session, the principal and identity thread objects, etc.. etc.. where can I find information?
View 3 Replies