membership-provider

SqlMembershipProvider: use my own database as user store database

假装没事ソ 提交于 2019-12-06 01:33:04
I'm developing an ASP.NET application with Visual Studio 2008 SP1 and C# . I'm also using Sql Server 2008 SP1 . I'm trying to add the tables created with the command aspnet_regsql -S (local) -E -A m to my own database. If I run that command it will create a database ( Aspnetdb database) with four tables. I want to know if there is a command that creates those tables in my own database (called myDatabase , for example). And, when the tables are created. How can I connect authentication to myDatabase ? Thank you aspnet_regsql-C "Data Source=.\SQLEXPRESS;Integrated Security=True;User Instance

ASP.NET Membership Authentication through Service

不打扰是莪最后的温柔 提交于 2019-12-06 00:32:32
Objective: I want to create a web service that allows me to connect to it (through ASP.NET Web Application) and then authenticate users just as Membership Provider Does/Role Provider Does. I do not want to use Membership/Role Provider by configuring at the ASP.NET Web Application's Web.config. Instead, what i would like, is to have some sort of configuration that points my Asp.net Web Application to a webservice (the one i want to create), that than authenticates the user. Expected Solution: what i found after some google research, that the solution might be: WCF Authentication Service. But I

attribute for .net MVC controller action method

核能气质少年 提交于 2019-12-05 22:12:13
问题 Essentially I want to show a friendly message when someone is not part of a role listed in my attribute. Currently my application just spits the user back to the log in screen. I've read a few posts that talk about creating a custom attribute that just extends [AuthorizeAttribute], but I'm thinking there's got to be something out of the box to do this? can someone please point me in the right direction of where I need to look to not have it send the user to the log in form, but rather just

Error when deleting user mvc 4 using SimpleMembership

给你一囗甜甜゛ 提交于 2019-12-05 12:30:33
When I try Membership.DeleteUser(string, bool) in a MVC 4 project where I use SimpleMembership provider, I get following error message: "The DELETE statement conflicted with the REFERENCE constraint "fk_UserId". The conflict occurred in database "Conductor_Basic3", table "dbo.webpages_UsersInRoles", column 'UserId'. The statement has been terminated." The constraints is set and is correct, so I can't really understand the error message. I guess I've missed something here. Can anyone explain to me this error? Looks like the table webpages_Roles has reference to your user, you should to exclude

code first membership provider

匆匆过客 提交于 2019-12-05 04:41:51
问题 How can I integrate EF 5.0 with membership provider using code first? I have my own database schema which I want to use for registration of users etc. 回答1: You should take a look at the SimpleMembershipProvider It is very easy to use it together with EF. Update For MVC4 I would start with the blank template. you need WebSecurity.InitializeDatabaseConnection to set up the database. WebSecurity.InitializeDatabaseConnection("DefaultConnection", "Users", "Id", "UserName", true); It takes as

ASP.NET Membership.ValidateUser() always return “false” [duplicate]

允我心安 提交于 2019-12-05 01:27:57
问题 This question already has answers here : Membership.ValidateUser always return false on IIS (2 answers) Closed 3 years ago . Here is my web.config: <membership defaultProvider="CustomizedMembershipProvider"> <providers> <clear /> <add name="CustomizedMembershipProvider" connectionStringName="MYbdName" applicationName="/" type="System.Web.Security.SqlMembershipProvider" requiresQuestionAndAnswer="false" passwordFormat="Clear" enablePasswordRetrieval="true" requiresUniqueEmail="true"

Compare string to null - Why does Resharper think this is always false?

徘徊边缘 提交于 2019-12-04 18:41:26
问题 I have this code in my custom MembershipProvider: public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (config == null) throw new ArgumentNullException("config"); if (name == null) name = "MyCustomMembershipProvider"; ... } Resharper marks the second if-Statement and tells me, it would always evaluate to false. But why would this always evaluate to false? I could easily pass null to the method as a parameter. Is this a bug or is

Assigning Roles with MVC SimpleMembership

半腔热情 提交于 2019-12-04 17:35:38
问题 I am trying out "SimpleMembership" in MVC3 via Nuget and have downloaded the sample to play with. The issue is that I cannot figure out how I would assign a role to a particular user. In the standard MVC membership you can just use something like: Roles.AddUserToRole(model.UserName, "StandardUser"); However, SimpleMembership only seems to have one method for roles exposed (unless Im being stupid!) which is public void RequireRoles(params string[] roles) { WebSecurity.RequireRoles(roles); }

what is the differences between Membership, SimpleMembership, ASP.NET Identity?

。_饼干妹妹 提交于 2019-12-04 16:45:31
问题 what is the differences between Membership , SimpleMembership , ASP.NET Identity ? Which one is best in web forms? How to use SimpleMembership in web forms. Limitation with SimpleMembership in web forms. 回答1: You listed them in progressive order by age. The Asp.net Membership Provider was first introduced with .net 2.0. Later. Simple Membership was released but most recently Microsoft has replaced SimpleMembership with Asp.net Identity (Microsoft.Aspnet.Identity.Core). This article should

ASP.NET: Where can I find a fast custom membership provider

泪湿孤枕 提交于 2019-12-04 15:44:45
问题 is there any custom asp.net membership providers that someone has already created online. I want to use a custom provider because their role provider is very sluggish and I would like to use integers instead of guids for user IDs 回答1: There can be no alternative implementations of the standard membership provider API, given that it is based on non-generic interfaces. However, in practice the whole membership API adds very little value and it is fairly easy to roll your own solution. To help