asp.net-membership

asp.net mvc custom membership provider - strict login cache to one application

邮差的信 提交于 2019-12-24 17:31:12
问题 I created custom membership provider for asp.net mvc applications and it all works fine except one thing: when logged in to my application, I am also logged in to all other asp.net mvc applications that I run using Visual Studio. I suppose this data is being pulled from cache because when I logout and try to login again in other application, I'm being rejected. In webconfig, I added applicationName in order to solve this but it didn't work: <membership defaultProvider="SAMembershipProvider"

Create user in another Membership.ApplicationName

梦想与她 提交于 2019-12-24 16:27:37
问题 I have an administration website - the users of which should be able to modify users for a public site. This means the administration site has a valid membership provider, but I want to be able to access/change members in another site (and therefore ApplicationName). First thought was to set ApplicationName on the Membership static - but that seems like a bad idea according to answers here: Changing Membership.ApplicationName in code - thread safety. Second thought was to duplicate the

ASP.NET Membership - Add extra field to ASP.Net Login page

人盡茶涼 提交于 2019-12-24 12:36:24
问题 Currently in My application, validating the users using the ASP.Net membership provider and the ASP.Net default Login page contains only Username and Password. This is working fine with this two fields. But as per my current requirement, need an extra field "Company" display as dropdownlist in ASP.Net Login page and validate the three Company, Username and Password using the ASP.NET membership provider. Is this possible or not, customize the ASP.Net Login page with an extra field using ASP

Get One MembershipUser from MembershipUserCollection

北城以北 提交于 2019-12-24 11:47:03
问题 I have a membershipusercollection that I am trying to get one specific user from. Unfortunately I cannot user the MembershipUser.GetUser() method. So currently I have a collection of all membership users like so: MembershipUserCollection mc = Membership.GetAllUsers(); What I would like to do is get one of these users by either login or email (doesn't matter which). I realize I can do a foreach loop on the collection and compare but I have to imagine there is a better way.... Thanks in advance

Get Single MembershipUser from MembershipUserCollection

99封情书 提交于 2019-12-24 10:45:01
问题 I'm learning ASP.Net MVC3 EF4 by coding a sample app. I'm using the standard Membership Provider. I have the requiresUniqueEmail="true" in the Membership provider so no more than 1 email per MembershipUser. I want to find a particular user by their email address. There is a function that helps: MembershipUserCollection users = Membership.FindUsersByEmail(model.Email); Since I have unique emails, how do I get the MembershipUser from the MembershipUserCollection? I know I can do a foreach loop:

Application loses authentication when performing redirect to a virtual directory

99封情书 提交于 2019-12-24 08:46:01
问题 I have the following setup: http://www.example.com/dir1/ and http://www.example.com/dir2/ Each virtual directory is configured on IIS6.0 as an application with own AppPool. When redirecting authenticated user from dir1 to dir2 using response.redirect I lose authentication information for the user and the user is being redirected to the login page. This issue was not coming up with each app (dir1 and dir2) were configured under subdomain, ex: http://dir1.example.com and http://dir2.example.com

OnLoggedIn event on Login page ASP.NET

雨燕双飞 提交于 2019-12-24 08:42:18
问题 I want to redirect people according to their role in the asp.net membership provider. I have some code in 'OnLoggedIn' event on the login page. Here is what I tried so far, and nothing doesn't work: The code below returns false on the .IsAuthenticated step, it says the user is not authenticated. On which step at the login page the user is authenticated, I thought the 'OnLoggedIn' event is the right place to do this. if (HttpContext.Current.User != null) { if (HttpContext.Current.User.Identity

MS Edge handles 401 errors thus bypassing my error handler

十年热恋 提交于 2019-12-24 08:41:33
问题 I have code to make ajax calls to my web service in javascript as follows: $.ajax( { url: url, data: json, type: "POST", processData: false, contentType: "application/json", timeout: 10000, dataType: "text", global: false, success: function (result, jqXHR) { sccParams = { result: result, jqXHR: jqXHR, } successResult(sccParams) }, error: function (jqXHR, textStatus, errorThrown) { errParams = { jqXHR: jqXHR, textStatus: textStatus, errorThrown: errorThrown, } errorHandler(errParams); } });

ASP.NET see if member is online

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 03:29:51
问题 I'm developing a ASP.NET site in umbraco, and I need to see if a member with a given ID is online. How can I do that? So far, I've tried to get the member by so: Member m = new Member(myID); But how can I check, if the returned member is logged in or not? EDIT: I followed the link, and extracted the following code from it: var users = Membership.GetAllUsers(); foreach(MembershipUser user in users){ Response.Write(user.IsOnline.ToString() +"<br/>"); Response.Write(user.LastActivityDate

ASP.NET Web Site Administration Tool unkown Error ASP.NET 4 VS 2010

微笑、不失礼 提交于 2019-12-24 03:11:14
问题 I was following the MVCMusic tutorial with an machine with full sql server 2008 r2 and full visual studio professional, in ASP.NET 4.0 and when I got to the page where it sets up membership (near page 66) the Web administration tool wont work, i got the following error: An error was encountered. Please return to the previous page and try again. my web config is like this: <connectionStrings> <clear /> <add name="MvcMusicStoreCN" connectionString="Data Source=.;Initial Catalog=MvcMusicStore