custom-membershipprovider

HttpContext.Current.User.Identity.Name is always string.Empty

Hi I use a custom MembershipProvider. I want to know the current username during an application scenario, but when I try accessing HttpContext.Current.User.Identity.Name it always returns string.Empty. if (Membership.ValidateUser(tbUsername.Text, tbPassword.Text)) { FormsAuthentication.SetAuthCookie(tbUsername.Text, true); bool...

I need to implement a window application and validate users against a SQL DB.

Is there a way I could use custom membership provider without need to create an asp service for it? I prefer validating the users right from within the application exe itself against the DB. OTOH I still want to have a login form that implements System.Web.ClientServices.Providers.ClientFormsAuthenticationCredentials and interact with Sy...

Unable to use Client Application Services with custom MembershipProvider.

Hi, I have a Windows-Forms Application that I configured to use with an ASP.NET Service that is an Authentication service using a custom MembershipProvider. When I call Membership.CreateUser in the Windows Application a NotSupportedException is thrown telling: "Specified method is not supported.". I tried creating a web page in the we...

Add Group Membership to Custom Membership/Roles provider

Hi Being fairly new to the MVC Framework, I am trying to establish a custom Membership provider which can support the concept of Groups or departments. I need to assign each user to belong to one (and only one) of several groups - each group (and its members) can only view records which belong to it - identified by the GroupId. I need...

How to handle ASP.NET Authentication

Hi, I have the following problem: I want to protect the access to some files hosted under IIS using an asp.net page. The page will be called from another application using: var request = WebRequest.Create("www.smth.com/protectData.aspx") as HttpWebRequest; request.Credentials = new NetworkCredentials("john doe", "john");...

Microsoft Membership Provider Vs Custom Provider Vs Complete Custom Login System

I am currently converting a very old, but working classic ASP site to ASP.Net. It has a completely custom written user management system. Whilst it works fine, it really needs a refresh as I want it to be more flexible for some future projects in the works. When I asked someone about this, they said "You need to use the Microsoft Provi...

Custom MembershipProvider with Web interface and DAL

Hi, I'm working on an ASP.NET solution with 2 projects. One is the web interface and the other contains my business logic. I'm using LINQ to SQL for my data access in the second project. Apart of my database, I have a table called Users which holds user information. I've started to implement a MembershipProvider. I notice that Members...

How do I pass more than one value to a custom RoleProvider GetUserRoles method in my MVC app?

I'd like to glue my custom permissioning system into a new ASP.NET MVC app. I've done a fair amount of work writing my own custom AuthorizeAttribute for the app. I've also written my own custom MembershipProvider and RoleProvider implementations. All of this works beautifully, up until I need to check the Roles my user is a part of. I d...

ASP.NET web.config Could not find the specified membership provider

Hi, I got this error message Could not find the specified membership provider Here's my web.config setting: <connectionStrings> <add name="MyConnectionString" connectionString="Data Source=MyHostName;Initial Catalog=MyDB;User ID=userid;Password=*****" providerName="System.Data.SqlClient" /> <add name="ADConnectionString" con...

ASP.NET Membership with two providers cant use GetAllUsers method

Hi, I'm using two membership providers. When I declared a following statement Dim allUsers As MembershipUserCollection = Membership.Providers("MembershipRoleManager").GetAllUsers Then, it gave me this error message. Argument not specified for paramenter 'totalRecords' of 'Public MustOverride Function GetAllUsers(pageIndex as Intege...

How can I debug a 'Default Membership Provider could not be found' error with WCF and a Custom ASP.NET membership provider?

This is problem for me with .Net 3.5 SP1 running on IIS7.5 64 bit (I tried forcing 32 bit but got the same result). I have a WCF service that I want to use authentication-services with. When I have no behavior the WCF service paints (replies) without any error. Other services also work with other behaviors As soon as I add userNameAuth...

Get rid of case sensitive username in custom membership provider

Hi, I implemented a custom membership provider in ASP.net MVC, and can't figure out how to make the username non case-sensitive at signin. So, for example, "Solomon" could log in, but "solomon" could not. My implementation is very bare bones. I basically just wrote code for ValidateUser(), and Change Password(). Thanks for the help!...

ASP.NET custom MembershipProvider

I have a client server application. The client is an asp.net c# site and the server is simply a command line application in c#. I plan on using .NET remoting to access and expose information that is on the server application and preset it to the user viewing the client. The server application has user objects that i want to use for aut...

ASP.NET Membership - keep users to use previous passwords

I created a Membership login system for my client, now they do NOT want the user to use one of his 5 last passwords when it comes time to create a new one. Is that something that is build in or how could I accomplish that? Thank you, Steve ...

ASP.NET: Custom MembershipProvider with a custom user table

I've recently started tinkering with ASP.NET MVC, but this question should apply to classic ASP.NET as well. For what it's worth, I don't know very much about forms authentication and membership providers either. I'm trying to write my own MembershipProvider which will be connected to my own custom user table in my database. My user tab...

How to fine tune a Membership Provider?

After all the answers to my last question about fine-tuning turned out to be more useful than I expected, I thought that I would ask another similar Question about the MembershipProviders as well. Okay, so firstly, to clarify: I know what a Membership, Role, and Profile provider is, how to implement my own, and how to configure them, an...

How can you inject an asp.net (mvc2) custom membership provider using Ninject?

OK, so I've been working on this for hours. I've found a couple of posts here, but nothing that actually resolves the problem. So, let me try it again... I have an MVC2 app using Ninject and a custom membership provider. If I try and inject the provider using the ctor, I get an error: 'No parameterless constructor defined for this ...

Can you use a custom membership provider with userNamePasswordValidationMode?

Every example I see uses the default Membership Provider with the userNamePasswordValidationMode, but can I specify MembershipProvider for userNamePasswordValidationMode in the ServiceCredentials for a WCF REST Service if I have a Custom Membership Provider? Is the following route the best to take if this is possible: Create a custom ...

Problem creating MembershipUser for custom MembershipProvider

Hello, I created a custom membership provider and am getting the following error trying to create a new "MembershipUser". Could not load type 'MyTestApp.Membership.TestMembershipProvider' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. I am running this from a Unit Test project, so I'm no...