asp.net-membership

AD Provider Membership.GetUser() cause error saying: "The parameter 'username' must not be empty."

Using the ActiveDirectory Provider, when i'm execute the Membershhip.GetUser() i got the following error massage saying: "The parameter 'username' must not be empty.". Here is the membership configuration: <membership defaultProvider="AspNetActiveDirectoryMembershipProvider" > <providers> <clear/> <add name="AspNetActiveDirec...

Is it possible to change the username with the Membership API

I am using the default sql membership provider with ASP.NET and I would like to provide a page to change the user's username. I believe I am sure I could do this with a custom provider, but can this be done with the default provider? Second part of my question is: Should I allow users to change their username after the account is create...

Membership.GetUser(username) - how to return correct casing?

I am getting the username from the URL so blah.com/kevinuk. I want some content on the page to say KevinUK which is whats stored in the membership table but when I do the following, it returns the same casing as what the input was. MembershipUser member = Membership.GetUser(user); string userName = member.UserName; How do I use a low...

How to integrate IoC Membership provider with ASP.NET MVC

I have a custom membership/roles provider that I use in my MVC controllers that I also want to have accessible to ASP.NET MVC, so I can use AuthorizationFilters, etc. Since so many people have implemented custom providers I imagine many people have done this but I haven't figured it out or found postings that address this problem specifi...

Can I add something to the user session in a custom MembershipProvider?

I am implementing a custom MembershipProvider in order to pass the login details to a custom business object that we use in several other places in our company. But once we have authenticated I'd like to save this initialized business object in the session to be used later in other pages. Let me give an example. public override bool Val...

ASP.NET Roles and Profiles: best way to query for collection of users who match custom profile property?

ASP.NET 2.0 membership, roles, and profiles is the cat's meow. The API for roles supports handy methods like GetAllUsersInRole("MyNewsletterSubscriber"), which will return a collection of people in the "MyNewsletterSubscriber" role. I am wondering what the best way to return a collection of people with custom ASP.NET Profile propertie...

How can I configure ASP.Net membership providers through code?

We're using ASP.Net membership providers (the SQL Server provider), and I want to be able to set up an Admin user account as part of our installer. To do this, I need the ASP.Net membership provider configured so that my installer can use it - but I don't want to have to set up a config file for the installer. So is there a way of confi...

Create Foreign Key to ASP.Net Roles table

I have a Pages table, I have a PagesRoles table with PageId, RoleID that links to ASP.Net Membership Roles table and the Pages table. I want to somehow return a Page that links to the currently logged in User's Roles. The User may be in more than one role. A Page can have more than one Role against it. I have a Page class that has a f...

Password Recovery without sending password via email

So, I've been playing with asp:PasswordRecovery and discovered I really don't like it, for several reasons: 1) Alice's password can be reset even without having access to Alice's email. A security question for password resets mitigates this, but does not really satisfy me. 2) Alice's new password is sent back to her in cleartext. I w...

Redisplay entered details if error on form ASP.NET MVC

I have been working on this problem for 2 days now and it's an easy problem and I just can't see the error in the code, even after comparing it with other projects where this works. Could you help out? I'm working on the account section of my website using ASP.NET Membership and the account controller class that is generated with ASP.N...

How to configure ASP.NET MembershipProvider with custom cryptography?

I want to set System.Web.Security.Membership.HashAlgorithmType (or thru web.config) to a custom Cryptography class I created, In this function I have Encrypt and Decrypt functions I wanna map the property value to use this class. How do I do it. PS. I don't mind to change the crypto class' struct, my point is using a custom crypto clas...

ASP.net Membership and profiles in WCF

I'm working on a WCF service that requires Membership and Profile access. I got the Membership stuff working by using System.Web.Security.Membership class and calling CreateUser() and ValidateUser() but i can't get the Profile to work. I don't even know what class to call, all the samples that i have seen are for ASP.net like the one i ...

CreateUserWizard and ContinueButton control

Hello, 1) A) One of the CreateUserWizard’s optional controls is also ContinueButton control. This control raises ContinueButtonClick event ( if CommandName is set to Continue ), but what is the purpose of this event? Thus, when should ContinueButton control be used? B) CreatingUser event is raised by clicking on CreateUserWizardst...

Best way to build member pages with EF and ASP.NET controls?

I'm trying to build a website that has a Member section, and I'm struggling to find a fast and efficient way to build the enduser pages, which will pull a user's data. For example, the user's "my account" page. They simply need to be able to view and edit the data. Would you use the Entity Frameworks EntityDataSource control? And bin...

Does SmtpClient class represent POP3 client or…?

I assume that web controls (such as the PasswordRecovery control) use SmtpClient to send email messages. If so, does SmtpClient represent a POP3 client or does SmtpClient forward email message to POP3 client? Do attributes specified inside <smtp> element in web.config map to SmtpClient class? <system.net> <mailSettings> <smtp de...

Does IIS7 use different default membership provider?

Hello, Say I create CreateUserWizard control and use AspNetSqlMembershipProvider (defined in machine.config) as a default membership provider. Assuming I change default provider's requiresQuestionAndAnswer attribute to false, then CreateUserWizard control template should not be required to provide Question and Answer fields. But if I...

How would you create a user database with asp.net mvc

i am new to asp.net mvc so please be explicit as possible. Here is my goal: i want to create a simple website where users can: Register and log in Enter there contact details(phone, address, etc) View there contact details Edit details of #3. Later in the website, i will create other pages that use this data but for now the only i...

When CreatedUser handler is called, profile for that user is not available

When using CreateUserWizard and setting LoginCreatedUser property to true, I would expect that since user is already authenticated by the time CreatedUser event handler is called, that profile for authenticated user would already be available. But that doesn’t seem to be the case. So when exactly does profile for authenticated user bec...

If i use a separated ASP.NET Membership database how should i handle the relations to the user tables?

If i use a separated ASP.NET Membership database what is the correct way to define the relations between the user tables and application data tables?. Should i create copies of the user tables and sync? or is ok to just create the Guid columns and enforce validation in the application code?, Are there any issues with performance that i s...

MembershipProvider and PasswordRecovery control

Hi, I need help using the PasswordRecovery control in .net 2.0. My situation is the application has changed from storing the passwordformat in Hashed to Clear. The problem is the newly created users have a clear password stored and there are still users with hashed passwords. When I use the passwordRecovery control as below for users w...