asp.net-membership

How do I call Initialize on a custom MembershipProvider?

Hi There, I have read through all the related questions, but I still unable to get the right solution for some reason, something is not right on my side, but not sure what's causing it. I have created a Custom Membership Provider, also changed my web.config to : <membership defaultProvider="MyMemberShipProvider"> <providers> ...

Best way to register different types of users asp.net mvc

I am looking to register 2 styles of user, they will both have different sets of data in the database. I am looking to use asp.nets membership roles. Are there any simple ways to do this in an mvc app using maybe the account controller? ...

.NET Membership Login ReturnUrl Override

I was wondering if anyone knows a proper/best practice way of overriding the url of where the page takes you after you successfully login. I tried this: protected void Login1_LoggedIn(object sender, EventArgs e) { if (Roles.IsUserInRole(Login1.UserName, "Other")) { Response.Redirect("/...

Obtain MembershipUser in ASP.NET MVC

I'm writing a new application in ASP.NET MVC. I've created a custom MembershipProvider that stores membership data in my own db schema. It all works, but how do I get the MembershipUser in my application, such that I can get the user key of the logged-on user and load model classes relating to that user? ...

Unable to load my custom membership provider?

Hi there, I was trying to implement a custom membership provider, everything goes well, I can connect, I can change user details, but as soon as I create user, I got this error when it tries to get the user after I complete create a user. The error is coming from my web.config, it is saying it's a ConfigurationErrorsException, and it a...

LoginControl not working correctly with Firefox, requires double login attempt.

Any idea why LoginControl requires users authenticate twice with FireFox but works correctly (once) with IE? I am using a custom MembershipProvider and RoleProvider, if that matters. Authentication portion of my web.config; <authentication mode="Forms"> <forms timeout="50000000" protection="All" requ...

How to delete FK one to many?

Hello, I have a table (aspnet_Membership) specifically that has spam records in it that I need to delete. There are some foreign keys and I'm trying to write a simple SQL statement to remove the FK's so I can delete the primary record. So theres a table called 'aspnet_UsersInRoles' that has UserID and RoleID, and in my 'aspnet_Membersh...

advantages of .net over java in Intranet

Our company has an intranet with 30,000+ web pages and 160+ web applications. This is being used by 5000+ employees. We also have internet with 150+ Web applications and 100+ websites. Both the internet and Intranet is 7+ years and they run on classic ASP. Recently some "Technical Architects" came up with a wonderful idea of migrating...

Can I call ASP.NET RegSQL from code?

Is it possible to call (the equivalent of) aspnet_regsql.exe from managed code? My idea is to create a class to automagically build the database for an installed web app, which uses the ASP.NET Membership provider. I could probably call aspnet_regsql.exe direct from code, but I came across the RegSql class(http://msdn.microsoft.com/en-...

ASP.NET MVC – Mock Membership for Controller Test

I’m not sure how to mock an ASP.NET Membership for my controller test. Controller Code: MembershipUser username = Membership.GetUser(); string UserID = username.UserName.ToString(); Does anyone know how to mock this for a controller test? I'm using RhinoMocks. ...

Why am I getting a NullReferenceException from Membership.GetCurrentUserName ?

I've just switched to using msbuild to precompile my website and now I'm getting this strange error: I have a call to Membership.GetUser() which throws: [NullReferenceException: Object reference not set to an instance of an object.] System.Web.Security.Membership.GetCurrentUserName() +36 System.Web.Security.Membership.GetUser() +7 ... ...

ASP.NET membership provider on a different development machine

Is the "asp.net membership provider" portable? Do I have to run the aspnet_regsql.exe to set it up for every new machine? I imported the membership provider database to Visual Studio Database Edition and checked into my source control, and redeployed it to a different dev machine. From the new machine, I got the following error. How d...

ASP.NET Application Services - how to create a new user account?

I've been playing around with ASP.NET Application Services. I've implemented the Authentication Service, Profile Service and Role Service successfully, able to log in and get Profile information for the logged in user and Role information. Now I've noticed a major shortfall in the fact that I can't work out how to create a new user acco...

ASP.NET Application Services and an ASP.NET website

I'm busy building a .NET WCF framework for my company which will allow us to quickly and easily implement community type websites moving forward. The framework currently caters for things like Blogging, Forums and commenting on them etc. I wanted to now implement Membership into the framework, and read up about ASP.NET Application Serv...

Application Services - ProfileService.GetPropertiesForCurrentUser "You must log on..."

I've successfully implemented and configured the AuthenticationService and ProfileService on MyWebsiteA. I created MyWebsiteB and added service references to the AuthenticationService and ProfileService on MyWebsiteA. On one of my pages I call the Login() and it returns true, however If I then try the ProfileService.GetPropertiesForCurre...

asp.net membership provider compromised?

I'm using the standard out-of-the-box aspnet membership provider, and I have the following settings in the web.config: <anonymousIdentification enabled="false"/> <authentication mode="Forms"> <forms cookieless="AutoDetect" loginUrl="~/XXXX.aspx" name="XXXXAuth" slidingExpiration="true" timeout="432000"/> </authentication> ... <membe...

How do I define the password rules for the ASP.NET Membership Provider?

When using web forms authentication with the ASP.NET Membership provider, we are defaulted to some decently strict password rules. I think eight characters, including one non-alpha, are required. I'm not looking to make them all willy-nill loose, but generally I do not use a non-alpha character in my own password, and feel like a hypocr...

Making user login persistant with ASP .Net Membership

I have a website that is built in ASP.NET 3.5 & SQL Server 2005, using the sql membership provider, and presumably forms authentication. Since security needs on my site are very low, I would like to authenticate once, and then keep the log in persisted indefinitely (without giving the user the choice). What is happening is that the use...

Alternatives to .Net Membership

Are there any alternatives\mods to .net Membership? I find it quite restrictive; Cant change Username, easily. You have to create a new user and copy the fields, but then you lose the primary key OR you have to edit the user table directly yourself. Additional profile fields are stored together as one blob. ...

ASP .NET anonymous users not getting stored in database

I'm trying to setup anonymous users in MVC. For some reason it wont store the users in the database. I have added the following in the web.config <anonymousIdentification enabled="true" /> It successfully creates the .ASPXANONYMOUS cookie when i visit the site but doesn't create the user in the database. Is this something i have to d...