asp.net-membership

How to use MembershipValidatePasswordEventHandler?

点点圈 提交于 2019-12-22 13:51:42
问题 Is there any way to put some restriction on password selection while creating new user with asp. net Membership.?? Condition Like Password strength: Minimum of 8 characters, with character complexity enforced. ie: Not contain the user's account name Be at least eight characters in length Contain characters from three of the following four categories: English uppercase characters (A through Z) English lowercase characters (a through z) Base 10 digits (0 through 9) Non-alphabetic characters

NotSupportedException when casting Membership.GetAllUsers() to generic list

萝らか妹 提交于 2019-12-22 10:46:40
问题 I am trying to use LINQ on the .NET Membership.GetAllUsers() collection, for example when getting all usernames: var usernames = Membership.GetAllUsers().Cast<MembershipUser>().Select(x=>x.UserName).ToList(); But VS tells me that it is not supported.. Membership is a part of Web.Security, same as MembershipUser Here is my connection string (if that is of any relevance): <add name="ApplicationServices" connectionString="Data Source=somerserver.xx\SQLEXPRESS;Initial Catalog=bedriftsmelding;User

Custom ASP.NET SqlMembershipProvider - handling connection string

五迷三道 提交于 2019-12-22 10:45:45
问题 I am creating a custom SqlMembershipProvider class to add some enhanced functionality to the base class. I'm getting caught up on handling the connection string, though. How can I read the Connection String Name from the configuration and make that available to the rest of the methods? Right now I have: public override void Initialize(string name, NameValueCollection config) { base.Initialize(name, config); _ConnectionStringName = config["connectionStringName"]; } But in other methods, the

With ASP.Net Membership, can a multiple Membership providers be used for login to the same website?

孤人 提交于 2019-12-22 10:36:36
问题 The situation is this: We have several (19) sites that are currently configured to share a single ASP Membership database using different applicationNames, such as: <membership defaultProvider="Site1Membership"> <providers> <add applicationName="/site1" name="Site1Membership" /> <add applicationName="/site2" name="Site2Membership" /> </providers> </membership> My question is if there are multiple providers defined in web.config, can a user login via other than the default provider? In the

Asp.Net membership via ASP.NET Website Administrator Tool

半世苍凉 提交于 2019-12-22 08:33:02
问题 I created a database with aspnet_regsql, the database was created in sql sever 2008 and not in data folder in my project (do I need to move it to the folder manually?). Next, in Web Site Administration Tool I went to provider section and clicked don Test button. I got an error: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the

Providing custom database functionality to custom asp.net membership provider

陌路散爱 提交于 2019-12-22 06:32:24
问题 I am creating custom membership provider for my asp.net application. I have also created a separate class "DBConnect" that provides database functionality such as Executing SQL statement, Executing SPs, Executing SPs or Query and returning SqlDataReader and so on... I have created instance of DBConnect class within Session_Start of Global.asax and stored to a session. Later using a static class I am providing the database functionality throughout the application using the same single session.

Is it possible to have email addresses encrypted in ApplicationServices DB?

南笙酒味 提交于 2019-12-22 05:57:17
问题 For additional security to keep email addresses private in a project I am working on, I would like to have all emails stored in our database encrypted. However, we are using the Asp.Net Membership provider, and emails appear in clear text in the Email column of table aspnet_Membership. Is their way to achieve this? Ideally, a simple way. 回答1: I would create a custom provider and just add the small amount of code to encrypt the email address. they released source for the ASP.net Provider http:

Authentication with an SOA approach using C#

孤者浪人 提交于 2019-12-22 05:15:13
问题 I am doing a rebuild of a website and I'm trying to use an SOA approach. The current website is in .NET 2.0 and uses the out of the box SqlMembershipProvider. We're trying to eliminate direct connections to the database and push everything through a WCF service layer. The approach we're using for this is to have everything separated - There's a library for models and interfaces, a library for the services, and then a library for the service proxies. The biggest hurdle so far is figuring out

Update custom user profile fields with SimpleMembershipProvider?

ぐ巨炮叔叔 提交于 2019-12-22 04:45:14
问题 I added a custom field to the UserProfile table named ClassOfYear and I'm able to get the data into the profile during registration like this: var confirmationToken = WebSecurity.CreateUserAndAccount(model.UserName, model.Password, propertyValues: new { ClassOfYear = model.ClassOfYear }, requireConfirmationToken: true); However, now I want to be able to update the profile when I manage it but I can't seem to find a method to do so. Do I need to simply update the UserProfile table myself? If

Get specific membership provider

血红的双手。 提交于 2019-12-22 04:32:27
问题 Is there a way to obtain a specific membership provider? When you make calls to the static Membership methods they query whatever provider you have configured as the defaultProvider . Is it possible to get a reference to a specific provider that is configured in your web.config and query against only that provider? 回答1: Yes, if you have multiple providers configured in your web.config, you can look them up by name. MembershipProvider membershipProvider = Membership.Providers["foo"]; 来源: https