asp.net-membership

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

你说的曾经没有我的故事 提交于 2019-12-05 19:15:41
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 given configuration, obviously a user stored in the default provider with an applicationName of "/site1"

Custom ASP.NET SqlMembershipProvider - handling connection string

霸气de小男生 提交于 2019-12-05 18:56:00
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 _ConnectionStringName variable is null: SqlConnection conn = new SqlConnection(ConfigurationManager

ASP.NET Membership change password not working

蹲街弑〆低调 提交于 2019-12-05 14:44:10
问题 I have this code for changing a user's password when they click the password reset button (with extra code to log to ELMAH so I can try to figure out what is going wrong). This is in ASP.NET MVC 2, using the standard aspnet membership provider, with a simple View like this: New Password: ______ Confirm Password: ______ [Reset] [Cancel] The route to this view is /Account/Reset/guid , where guid is the user's id in the aspnet membership database. The key portion of the code is where it calls

Why does httpRuntime targetFramework=“4.5” disable grabbing the .ASPXAUTH cookie?

荒凉一梦 提交于 2019-12-05 14:26:06
When my web.config has the below httpRuntime, my controller cannot grab the cookie .ASPXAUTH. It seems to be able to grab any other cookie, with or without the period prefix. If I delete the below line, it works fine. <httpRuntime targetFramework="4.5"/> I'm using the following to grab the cookie. HttpCookie authCookie = Request.Cookies[".ASPXAUTH"]; Why can't I grab the Forms Authentication cookie? I had similar problem - my app with runtime 4.5 was unable to read an .ASPXAUTH cookie created by another /login/ app that was running under 4.0, causing a redirect loop. Turns out 4.5 introduces

Wrapping membership provider and dbcontext on single transaction

◇◆丶佛笑我妖孽 提交于 2019-12-05 14:15:59
MVC Project using EF 5 code first and .NET 4.5. I was looking for a way to wrap dbContext and SimpleMembershipProvider on a single transaction. I tried to use TransactionScope but since the membership provider will open another connection I get an exception (MSDTC on server 'servername' is unavailable). So I though I could use ObjectContext.Connection.BeginTransaction instead. The membership provider won't be part of the transaction but the idea is to have it somewhere where if it fails the transaction won't be committed. Book bk1 = default(Book); Book bk2 = default(Book); object obc =

Asp.Net membership via ASP.NET Website Administrator Tool

走远了吗. 提交于 2019-12-05 13:40:41
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 database, and then return to this tool to set the provider. Maybe I need to set something in a web.config,

How do I get the ID of the current logged in user?

喜你入骨 提交于 2019-12-05 12:37:51
I'm working on a sample project built from the ASP.NET Web Application template (web forms, not MVC). After a user logs in, I want to grab the user's ID and store it in a session variable so I can pass it between pages. How do I get the user's ID from the ASP.NET membership provider? By user's ID, I'm referring to the GUID in the membership database. Is there a method to get the user's ID? I'm using the default database schema and have it deployed to my server. Thanks! Try this: MembershipUser membershipUser = Membership.GetUser(); string UserID = membershipUser.ProviderUserKey.ToString(); You

SQL aspnet_profile

会有一股神秘感。 提交于 2019-12-05 11:13:07
any idea how I can get user FirstName and LastName from the aspnet_profile table based on UserID using SQL becasue I would like to use in Telerik Reporting as a user parameter. Sample row (FirstName is George, LastName is Test): UserID: 06b24b5c-9aa1-426e-b7e4-0771c5f85e85 PropertyName: MobilePhone:S:0:0:Initials:S:0:1:City:S:1:14:FirstName:S:15:6:PostalCode:S:21:7:‌​WorkPhone:S:28:12:LastName:S:40:5:Address1:S:45:17:Address2:S:62:0:Province:S:62:‌​2:Organization:S:64:4:ClinicId:S:68:1:Country:S:69:6:Fax:S:75:0:MSPNumber:S:75:0:‌​ PropertyValuesString: HEast HustonEASGeorgeT7D 1N8604-111

ASP.NET Forms Authentication With Only UserName

痴心易碎 提交于 2019-12-05 10:35:54
问题 I have a bit of a hybrid situation on my hands. I'm writing an intranet asp.net web app. I don't want to use full blown Windows Authentication, because I don't have proper groups set up in Active Directory to be able to authenticate users simply based on what group they are in. Up until now, I had created a membership database, and was manually authenticating users based on their NT Login. The app is getting more complex, and I'm looking at using the Membership and Roles providers to

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

我怕爱的太早我们不能终老 提交于 2019-12-05 08:24:13
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. 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://weblogs.asp.net/scottgu/archive/2006/04/13/442772.aspx if you download the ProviderToolkitSamples.msi Use