asp.net-membership

How to set password rules for ASP.NET identity?

亡梦爱人 提交于 2020-01-09 13:10:06
问题 In my ASP.NET applications I have following settings in DefaultMembershipProvider and SqlMembershipProvider in web.config: enablePasswordRetrieval="true" passwordFormat="Clear" requiresQuestionAndAnswer="false" They are required for Digest authentication. I would like to move to ASP.NET Identity. I am using automated tool to update all web.config files that I manage. How do I set these settings for ASP.NET Identity in the project generated by Visual Studio 2013? 回答1: You need to provide

How to set password rules for ASP.NET identity?

喜欢而已 提交于 2020-01-09 13:07:06
问题 In my ASP.NET applications I have following settings in DefaultMembershipProvider and SqlMembershipProvider in web.config: enablePasswordRetrieval="true" passwordFormat="Clear" requiresQuestionAndAnswer="false" They are required for Digest authentication. I would like to move to ASP.NET Identity. I am using automated tool to update all web.config files that I manage. How do I set these settings for ASP.NET Identity in the project generated by Visual Studio 2013? 回答1: You need to provide

How do I call Initialize on a custom MembershipProvider?

穿精又带淫゛_ 提交于 2020-01-09 09:02:57
问题 I have read through all the related questions, but I still unable to get the right solution for some reason, something is not right on my side, but not sure what's causing it. I have created a Custom Membership Provider, also changed my web.config to : <membership defaultProvider="MyMemberShipProvider"> <providers> <clear /> <add name="MyMemberShipProvider" type="MyNameSpace.MyMemberShipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset=

setting up mailsettings in asp.net web.config

纵然是瞬间 提交于 2020-01-07 05:49:25
问题 I am trying to send registration email from asp.net login page. but there appear different type of issues <mailSettings> <smtp from="mail@spiralsnet.com"> <network host="localhost" defaultCredentials ="false" username="mail@domain.com" password="passord"/> </smtp> </mailSettings> when I use this setting I get this error Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on

Custom ASPNetMembership FailureInformation always null, OnValidatingPassword issue

依然范特西╮ 提交于 2020-01-07 04:09:16
问题 As stated here http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.onvalidatingpassword.aspx "When the ValidatingPassword event has completed, the properties of the ValidatePasswordEventArgs object supplied as the e parameter can be examined to determine whether the current action should be canceled and if a particular Exception, stored in the FailureInformation property, should be thrown." Here is some details/code which really shows why FailureInformation could be

URL-authorization and non-Asp.Net related file types

。_饼干妹妹 提交于 2020-01-07 00:30:55
问题 URL authorization only applies to Asp.Net related file types?1 But why couldn’t it also be applied to non-Asp.Net file types? Thanx 回答1: This is because of the script maps for ASP.NET. Only certain extensions are mapped into ASP.NET. The rest are handled directly by IIS. This is by design, for performance reasons. There are two ways to handle this. Duplicate your authorization rules in the web.config files in NTFS File ACLs (that is, set permissions on folders and files directly). Make sure

URL-authorization and non-Asp.Net related file types

老子叫甜甜 提交于 2020-01-07 00:29:07
问题 URL authorization only applies to Asp.Net related file types?1 But why couldn’t it also be applied to non-Asp.Net file types? Thanx 回答1: This is because of the script maps for ASP.NET. Only certain extensions are mapped into ASP.NET. The rest are handled directly by IIS. This is by design, for performance reasons. There are two ways to handle this. Duplicate your authorization rules in the web.config files in NTFS File ACLs (that is, set permissions on folders and files directly). Make sure

Update _Layout for different type of users

江枫思渺然 提交于 2020-01-06 18:13:16
问题 I'm using the MVC template on Asp.net MVC 4, and I have a UserProfile (t class with the UserType (this field receive only 2 values, "Ouvinte" and "Musico") field, that works like roles in application, right? My idea is, make a verification on _Layout.cshtml to know what is the UserType that are logged on application and modify the navbar on top. THIS IS MY NAVBAR ON _Layout <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type=

acessing username in web api controller when database table stores user as integer

跟風遠走 提交于 2020-01-06 18:02:34
问题 Inside some web api controllers, I would like to access the User as indicated in this answer: https://stackoverflow.com/a/12705062/538962 sample code from answer... [Authorize] public List<Product> GetProductsFromId() { string username = User.Identity.Name; return _productService.GetProductsFromUsername(username); } The asp_net membership tables in my scenario are on a different database server than then the database server the application runs on. The database for the application has its own

How do I add first user (root) in ASP.NET MVC app?

若如初见. 提交于 2020-01-06 02:54:08
问题 I'm using ASP.NET MVC Framwork and trying to grok the ASP Membership 3.5 stuff. What is the best way to add the first administrator user without having to log in? I've been staring at the membership starter kit's source without finding it. 回答1: A simple solution (especially or rather only for dev. purposes) by doing it in a "setup" action: if (!Roles.RoleExists("Administrator")) { Roles.CreateRole("Administrator"); } if (Membership.GetUser("Admin") == null) { Membership.CreateUser("Admin",