.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Membership Provider: Remove Secret Question .net 4.0

Posted By:      Posted Date: September 12, 2010    Points: 0   Category :ASP.Net
Im trying to remove the secret question / answer from the create user wizard control. I have removed the controls from the template but in previous versions of .net, you had to edit the web.config requiresecretquestion field to false.. I cant find this in the 4.0 web.config. When i try to add the Membership provider tag, i get an error saying its already added. Where is this being stored now? I cant seem to find it :(

View Complete Post

More Related Resource Links

membership provider with custom login form problem / question

Hi all, I am using the .net membership provider, and I can get past the membership.validate user ok and into my secure page.   The problem I have is that when I reach the secured page, I have a login status control which isn't changing from login to logout.   Below is my login code:If Membership.ValidateUser(txtUsername.Text, txtPassword.Text) Then Response.Redirect("/auth/Default.aspx") If chkRememberMe.Checked Then FormsAuthentication.SetAuthCookie(txtUsername.Text, True) Else FormsAuthentication.SetAuthCookie(txtUsername.Text, False) End If Else lblLoginStatus.Text = "Oops! Login not found!" End If    Thanks in advance.

AD Membership Provider Question


From the MS How-To http://msdn2.microsoft.com/en-us/library/ms998360.aspx, I know that when the membership provider locks an account, it's not actually locked out with AD.  Without using the membership provider's UnlockUser() method, how do I unlock an account?

My ultimate goal is to use the membership provider in my web app to authenticate against AD.  I don't want my web app to be able to unlock users, or allow them to change passwords.  I'd like to control the lockout parameters (ie. 5 invalid pwd attempts within 10 mins).  In the event of a lockout, I'd like the account to automatically unlock after a specified period of time (ie. 30 minutes).  From what I understand, the numbers I just used as examples are the defaults, however ...

My web.config file looks like this:

<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
       type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Membership Provider Conn String


Hello. I've bee successfully using the Asp.Net Membership Provider in my VB.Net 3.5/SQL 2005 web app for a year now (Site A). However, I've added 2 new sites (B and C) (both with their own DB) and now I see a problem. It looks like users that get created for sites B and C also get created in site A. Roles that I create for B and C only get created in A. I think it is a conn string problem.

When I created A, I adde the conn string to my machine.config (not sure why I did this or if it is even needed)...


         <add name="LocalSqlServer" connectionString="Data Source=VS689\SQLEXPRESS;Initial Catalog=SiteA;USER ID=sa;PASSWORD=123456"/>


                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=blahblah" connectionStringName="LocalSqlS

Membership provider for MS Access in VB


Hi all,

Over the past few weeks I've been attempting to convert the readily available C# code for the Membership Provider etc whilst working with MS Access. I'm fairly experienced with VB unlike C# and have ran AccessMembershipProvider.cs, AccessConnectionHelper.cs and so on through 3 different converters. All of which have given a varying degree of errors, all of which I've fixed, either by ever so slightly re-writing the logic or in the Cryptographic case finding a working translation.

This evening I have fixed all of the errors from all of the now converted VB files (which I was pretty pleased about as you can imagine), I then created a simple login page to test this out, added a new user to the system and tried to login to find out I'm being told the username or password is wrong.

Just to clarify, the converters all had an error or two or even more in some cases which I've bypassed but now I can't login - at all!!

Any initial suggestions?

Finally I've written reams of code over the years and am really stumped on this one, has knowone actually successfully converted these files from C# to VB and actually got it working?? I'm not looking for someone to send me there hard work but I am almost at the point of not wanting to bother with it anymore and I just can't believe that it's not out there to download

Implementing a custom Membership Provider vs. using aspnet_Profile table - Which should I do?


I wanted to expand the amount of information that is associated with each user(MembershipUser) in the ASPNETDB.MDF database file. Adding columns like FirstName, LastName, etc. So I began implementing my own custom Membership Provider. I created a derived MembershipUser class with the extra private variables that I wanted each MembershipUser record to store. Its basically done. Almost after I did this I stumbled across the columns in the ASPNETDB.MDF->aspnet_Profile table called "PropertyNames" and "PropertyValuesString".  Could I have simply used these two columns to accomplish what I was attempting to do or are these columns for global application configuration settings?  

Is the aspnet_Profile table purpose to store expanded/related information about users such as personal information? Or is it for something else? Thanks.

Adding additional fields to my custom membership provider

Hi, i have been playing around with the membership provider model for the last week and have it got it working with a basic table schema.  The trouble i have is that i wish to add an additional field (eg First Name) but am not sure how i can do this.  Here's what i have so far: public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)    {        MembershipUser user = new MembershipUser(Name, username, providerUserKey, email, passwordQuestion, null, isApproved, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now);        string sql = "INSERT INTO USERS(USERNAME,PASSWORD,EMAIL,ISACTIVE) VALUES(@UID,@PWD,@EMAIL,@ISACTIVE)";        db.AddParameter("@UID", username);        db.AddParameter("@PWD", password);        db.AddParameter("@EMAIL", email);        db.AddParameter("@ISACTIVE", (isApproved == true ? "Y" : "N"));        int i = db.ExecuteNonQuery(sql); 

Webshop Security - Membership provider useful?

Hello,I have to implement a small webshop. Basically it's just a website with a huge backend ERP System and with the possibility to sell one (yap, really only one!) product on the website. The only requirement is a MySQL Server. The backend is almost finished (about 95%) and is secured with the .net MemberShip Provider for MySQL (the one in MySql.Web from the MySql Connector .NET).Now to my question: I can set up the membership system easily but I do not need such things like username or password-question but I would need a reference to an address table to store the users home address. So, it is possible to change or customize the membership system to for eg. a unique customer id instead of the username column and set this in codebehind when the user is creating a new account? And is it possible to insert new users/customers from codebehind in an easy way? (I mean without checking each foreign key and inserting the customer reference to the userinrole table and so on...)Some tips appreciated.. :-)Thanks and regardsChris 

Planning common membership provider for different authentication providers

I am trying to implement form based authentication (FBA) membership provider that is able to support multiple authentication mechanisms. Take it as an self-training experiment. In this posting I will introduce bases of my experiment and introduce my current plans and ideas. Why membership provider for multiple authentication mechanisms? There are many people in the world who are users of some social network or some open services provider. Today Facebook and Twitter are very popular social networks. Also Google and Microsoft Live services are very popular although they are not social networks. But all mentioned systems provide their own authentication channels also to other applications. The question is: why should I have another username and password if I have already one at some of systems I mentioned before? Here, in Estonia, we are building local Microsoft community portal with local Microsoft. We analyzed the situation and decided to use Live ID as authentication mechanism in our portal. We were a little it worried too because we were afraid that there are load of users who are not happy with Live ID as authentication mechanism. And guess what - as time has shown us there is no reason to worry! Our ~2000 users (Estonia is small country) are all happy with Live ID and the ones who doesn't have Live ID yet can go and join Live ID - it's free. If you have no idea where I l

How To Customize membership provider in asp.net 3.5!!!

hello there,                  I have more problem in costomize membership provider, i did download  the code in c# from videos tutorial, that code have Membership provider class. but i am unable to use that class. how i will use it.  can help any one, if have any confussion in my question so plz ask i will clear it but i want custome membership provider.thank you pranayesh pathak

Custom Membership Provider Problem

Hi there, I'm writing a web app using C# and .NET 2.0 (corporate environment, so I can't use 4.0) and I'm running into an issue with custom membership providers. Everything compiles, and looks like it should work, but I get this error when viewing the WSAT Security tab:  Could not load type 'BinCSF.Security.CUser' from assembly 'App_Code.f4qdas9h, Version=, Culture=neutral, PublicKeyToken=null' <membership> section of web.config: http://illogi.ca/l/snippets/bincsf_web_config.html BinCSF.Security.UserProvider: http://illogi.ca/l/snippets/bincsf_userprovider.html BinCSF.Security.CUser: http://illogi.ca/l/snippets/bincsf_cuser.html Any help would be greatly appreciated.

MySQL Membership Provider issue

Hi all,I managed to set up the membership and roles providers for MySQL using the MySQL .NET Connector. I got the mysql tables for membership and roles autogenerated, managed to add users and roles from the Website Administration tool, but now I have a very strange problem: if I user the CreateUserWizard control (absolutely no customization - just dragged it to the webform) everything works fine. The user is created and I can see it in my mysql table.on the other hand I tried using the Login control to authenticate users and implemented the OnAuthenticate="Login1_Authenticate" event using the code below:protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)         {             if (FormsAuthentication.Authenticate(Login1.UserName, Login1.Password))             {                 Response.Redirect("Secret.aspx");             }             else             {                 e.Authenticated = false;             }         }protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)

ASP.NET 5.0: Multiple logins and login types in default ASP.NET membership provider

What do you think about an ability of having multiple logins and login types to be attached to the same user? Let me explain this by showing how database schema can be re-factored to support this model:Remove [Password], [PasswordSalt] columns from [Users] database tableAdd [Logins] table with one-to-many relationship between [Users] and [Logins] tablesThis will allow one user to have multiple credentials attached to his or her account of different types such as Username&Password, Windows Live ID, Open ID from different providersYou will be able to restrict allowed login types and OpenID providers in web.config So.. do you think it is a good idea to add support of this model into ASP.NET 4.5/5.0 membership service?http://aspnet.codeplex.com/workitem/7149

Custom membership provider and FormsAuthentication.

Hello folk, I've implemented my custom membership provider. I use third server for authentication (call web method that validates user/password). I need this user/password for retrieve some additional data from this server. Asp.net MVC uses FormsAuthentication and cookie for keep 'login state' by default. It works well when I login on site first time. But when I close and open site again sometime after, cookie keeps it 'login' but I don't have credential for access to server data. I can change cookieless attribute (to 'UseUri' for example) in configure file but in this case I should login again if I open second tab with this app in same browser. My questions: Is way to call SingOut of FormsAuthentication (remove authentication ticket from browser) when user closes asp.net mvc app?Is secure way to pass user/password data through session? Because server is unstable and interrupt connection often and app should have possibility for silent reconnect.

Migrating existing cleat text users password to hashed password Membership Provider

Hello all ,I had been trying to solve this but there is a hidden key i wish someone point me to.I had a simple membership database with users in first the Membership  Provider configured for clear passwordto retrieve the original password .Now a new requirement say that the password must be hashed and reset .I configure the Membership password to hash , and Implemented the Reset Password Module.My problem is as follow.If the user is new registered user with the new configuration the password and the security answer is hashed.also when I go and reset the password it continue to be hashed.Now I thought that with new configuration if any previous user with clear text configuration , If he use the password Reset module , because my configuration now is hashed , I expected that the new password  and security answer will be hashed  . what happen is old user continue in clear text even if the configuration is hashed.so If I had new users everything is fine.old users Membership Provider somehow know they had been stored in clear text and it keep change password and security answer in clear text .If I delete this user and create it , Membership Provider understand that everything will be hashed.I need to know how it know this , I need to migrate users not to delete and recreate users .If there is a solution for that kindly expl

How to write a Custom Membership Provider

Hi guys, Can someone please tell me where to start with creating a custom membership and roles provider? I've found tons of information on how to implement a custom provider but not how to actually create it. I have an Oracle database with a users table. In this table I have a "Platform" column. I would like to authenticate through FBA only the users from this table who have a specific Platform value. Now I know i need to write a custsom membership provider that handles all sorts of requests but i really dont know what to base it on, where to add it in the sharepoint solution etc.   your help will be soooo greatly appreciated!The world is the mollusc of your choice

Web.config for Custom Membership Provider

I am trying to set-up the connection strings to my Membership Provider. I am using the Sql server database and not the default aspnet_db. Iam giving the Fully Qualifying namespace+class in my "type"  and it still throws an error msg "connection string cannot be blank". Web.config: < < < < membership defaultProvider="CustomMembershipProvider">providers>clear />add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="RavLoginApp" description="Stores and retrieves membership data from the local Microsoft SQL Server database" name="CustomMembershipProvider" type="MyNamespace.CustomMembershipProvider" />  </providers> </membership <connectionStrings > <remove name="LocalSqlServer" /> <add name="LocalSqlServer" connectionString="data source=;database=MyLocaldb;uid=xxxxx;pwd=xxxxxx" providerName="System.Data.SqlClient" /> <

Custom membership provider using MYSQLMemberShipr Provider

hi, I am implementing my custom membership provider for MYSQL for this I write thi code: public class CustomSqlMembershipProvider :MySQLMembershipProvider {   public override void Initialize(string name, NameValueCollection configs) { base.Initialize(name, configs); } } When I am compiling this class, getting an error: 'Project.Models.CustomSqlMembershipProvider': cannot derive from sealed type 'MySql.Web.Security.MySQLMembershipProvider' C:\Workarea\\Project\Models\CustomSqlMembershipProvider.cs Why I getting this error. I have added the MySql.web and MySql.Data assembly references thanks in advance Aayushi
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend