Questions tagged [asp.net-membership]

ASP.NET membership gives you a built-in way to validate and store user credentials.

ASP.NET Membership works on top of forms-authentication and gives you:

  • Ability to create and store users and their passwords with little or no code.
  • Out-of-the-box support for changing, resetting, retrieving and encrypting passwords.
  • Choice of two storage locations - SQL Server and Active Directory.
  • Custom providers can be created to store users in custom stores

Resources

MSDN - Introduction to Membership
4guysfromrolla - Examining ASP.NET's Membership, Roles, and Profile

3256 questions
1
vote
0 answers

Convert ASP.NET MVC membership to ASP.NET Core identity system

I have a website that is using ASP.NET MVC and membership. I added another ASP.NET Core API project, and I want to use the new identity system. My current membership login is like this: FormsAuthentication.Initialize(); DateTime expire =…
1
vote
3 answers

Custom Membership Provider and MembershipUser

I have simple question. I'm now thinking about creating custom membership provider for my app, because using separate tables for membership and for rest of the app is not that good idea.. not to mention some data is simply replicated along…
Łukasz Baran
  • 1,229
  • 3
  • 24
  • 47
1
vote
1 answer

Update User Entity Framework

I am writing an asp.net membership provider using Entity code first and I need some help understanding how to Update the MembershipUser object. The UpdateUsert(MembershipUser user) override method needs to be implemented and consists of a…
ChiliYago
  • 11,341
  • 23
  • 79
  • 126
1
vote
1 answer

asp.net membership db changes not committing

When a user registers, I set the IsApproved value to false until later. After "approval" I set the users .IsApproved=true. However, the change does not get committed to db. It does show change in debugging. Any ideas?
zsharp
  • 13,656
  • 29
  • 86
  • 152
1
vote
2 answers

Attached DB Can login but not create user "invalid value for key 'attachdbfilename'"

I have a application running on our server (it works fine on my computer not that it matters). It is a windows server 2003, Sql Express 2008 r2 server. Im using a attached DB for storing users (the asp.net supplied db). I can login to the web…
Peter
  • 37,042
  • 39
  • 142
  • 198
1
vote
0 answers

System.SecurityException when using Principal permissions with WCF and InstanceContextMode.Single

Im trying to add ASP .NET membership security to my Silverlight + WCF application but i keep getting the following exception intermittently: at System.Security.Permissions.PrincipalPermission.ThrowSecurityException() at…
Francisco
  • 11
  • 2
1
vote
0 answers

ASP.NET membership and SQL Server 2008 connection problem

I'm using ASP.Net Membership, IIS 7 and SQL Server 2008. I can connect to all the tables in the remote SQL Server except the Membership ones. I get this error: A network-related or instance-specific error occurred while establishing a…
1
vote
3 answers

Custom ValidateUser() in custom .net MembershipProvider

Is there a way to extend the ValidateUser method to receive other parameters than the default? Default public override bool ValidateUser(string username, string password) { return db.ValidateUser(username, password); } I'd like to…
Eric Herlitz
  • 25,354
  • 27
  • 113
  • 157
1
vote
2 answers

Custom Membership Provider Error

I have a custom asp.net membership class I am building where I have a helper function that the GetUser() method uses to convert the values from my database into a System.Web.Security.MembershipUser object. private MembershipUser…
ChiliYago
  • 11,341
  • 23
  • 79
  • 126
1
vote
2 answers

Prevent a property from being auto-scaffolded unless user role is administrator?

I have a model class that has an AreDuesPaid property that I want only administrators to be able to see and edit. The class looks something like this: public class ClubMember { [ScaffoldColumn(false)] public int Id { get; set; } …
devuxer
  • 41,681
  • 47
  • 180
  • 292
1
vote
4 answers

AspNetUsers to IdentityUser with Entity Framework Core

Background I have a project written with C# and ASP.NET core (v2.2). This project is connected to a database that holds a table called "AspNetUsers". The building strategy is "Database First". I'm building the models from the data with this command:…
No1Lives4Ever
  • 6,430
  • 19
  • 77
  • 140
1
vote
1 answer

Creating a Step-by-step Custom Membership Provider in ASP.NET C#

I'm making an online Library Management System in ASP.NET. Right now I'm following this http://mattwrock.com/post/2009/10/14/Implementing-custom-Membership-Provider-and-Role-Provider-for-Authinticating-ASPNET-MVC-Applications.aspx (for my user login…
Loupi
  • 1,102
  • 4
  • 25
  • 42
1
vote
1 answer

Membership.GetUser() always returns NULL on Visual Studio for Mac

I'm working on ASP.NET MVC project using (VS 2019 Preview for Mac) and got stuck on login and registration. When I call Membership.GetUser(login) I always got NULL as return. On Windows 7's VM I can get user info (password for example) but…
1
vote
1 answer

How I can create my own password in an empty membership table?

I need to create a user in an empty [aspnet_Membership] table. public string EncodePassword(string pass, string salt) { byte[] bIn = Encoding.Unicode.GetBytes(pass); byte[] bSalt = Convert.FromBase64String(salt); byte[] bAll = new…
kamiar3001
  • 2,646
  • 4
  • 42
  • 78
1
vote
2 answers

Do not store password in .net membership

I use the built in membership system in a MVC 3 .net application. Later in the developement I will use an external web service for authentication. Hence I would only have to store the (unique) username in the membership system. All other user info…
Morgan Bengtsson
  • 1,341
  • 1
  • 14
  • 23