membership

Why is ASP.NET FormsAuthentication cookie not authenticating user?

一世执手 提交于 2019-12-02 01:29:07
问题 I have a site that uses the default SqlMembershipProvider and FormsAuthentication. I can use the built-in Login Controls and/or programmatically call all the methods to authenticate a user and get the same result - the user is authenticated and a cookie is created, but the cookie does not appear to be valid since I can't get into any page that requires authentication. There is no real code to show for the default Login Control since it should just "work", but here is the custom code I tried:

Why is ASP.NET FormsAuthentication cookie not authenticating user?

南楼画角 提交于 2019-12-01 23:40:59
I have a site that uses the default SqlMembershipProvider and FormsAuthentication. I can use the built-in Login Controls and/or programmatically call all the methods to authenticate a user and get the same result - the user is authenticated and a cookie is created, but the cookie does not appear to be valid since I can't get into any page that requires authentication. There is no real code to show for the default Login Control since it should just "work", but here is the custom code I tried: protected void ctrlLogin_Authenticate(object sender, AuthenticateEventArgs e) { if (Membership

how to use Profile.GetProfile() in a library class?

二次信任 提交于 2019-12-01 19:38:23
I cant figure out how to use Profile.GetProfile() method in a library class. I tried using this method in a Page.aspx.cs and it worked perfectly. How can I make a method that works in the page.aspx.cs, work in the class library. In ASP.NET, Profile is a hook into the HttpContext.Current.Profile property, which returns a dynamically generated object of type ProfileCommon, derived from System.Web.Profile.ProfileBase . ProfileCommon apparently includes a GetProfile(string username) method, but you wont find it documented officially in MSDN (and it wont show up in intellisense in visual studio)

Unable to initialize provider. Missing or incorrect schema. for MySql.Web connector

跟風遠走 提交于 2019-12-01 16:59:22
Hey guys and gals running into a little issue here.. I'm trying to use MySql Connector 6.2.2.0 for membership and role providers.. The issue I'm having is: Unable to initialize provider. Missing or incorrect schema. <authentication mode="Forms"/> <roleManager defaultProvider="MySqlRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" > <providers> <clear /> <add name="MySqlRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.2.2.0

MVC 3 ninject custom membership context disposed error

北城余情 提交于 2019-12-01 13:14:19
I have a custom membership that uses my CustomerService to communicate with the database using EF code first (4.1) I use ninject to inject the CustomerService into my custom membership class. But when I try to validate I get a context disposed error. This is because in ninject my context, repositories and services are InRequestScope(). And because I inject the CustomerService using [inject] on a property of my custom membership and in ninject use the _kernel.Inject(Membership.Provider), it is only injected ones on startup. I read a lot of posts about this problem but can not find an answer

MVC 3 ninject custom membership context disposed error

空扰寡人 提交于 2019-12-01 11:44:58
问题 I have a custom membership that uses my CustomerService to communicate with the database using EF code first (4.1) I use ninject to inject the CustomerService into my custom membership class. But when I try to validate I get a context disposed error. This is because in ninject my context, repositories and services are InRequestScope(). And because I inject the CustomerService using [inject] on a property of my custom membership and in ninject use the _kernel.Inject(Membership.Provider), it is

ASP.NET to WCF - passthrough security?

让人想犯罪 __ 提交于 2019-12-01 09:03:07
问题 I have a MVC website that sits on top of a WCF service. The WCF service is also accessible to the internet with username/password authentication using message security and certificates. This is setup and working. Both the website and the service use the same membership store, using the membership API. A user can log onto either the website or the service using the same credentials. However, when the website calls the service, it needs to pass the credentials of the currently logged on user. I

ASP.NET SQL Profile Provider - Does the ProfileBase.Create() method hit DB?

爱⌒轻易说出口 提交于 2019-12-01 07:38:27
I am working with the SQLMemebershipProvider and using Profiles. I have a custom class called UserProfile that inherits from the ProfileBase class and I use this to set custom properties like "FullName". I am wanting to loop through all the users in the database and get access to their profile properties. On each iteration I am calling ProfileBase.Create() to get a new profile and then access the properties. It looks to me like every time ProfileBase.Create() is called it hits my SQL database. But I am just looking for confirmation of this. So, does anyone know if this does in fact hit the DB

ASP.NET SQL Profile Provider - Does the ProfileBase.Create() method hit DB?

久未见 提交于 2019-12-01 05:09:21
问题 I am working with the SQLMemebershipProvider and using Profiles. I have a custom class called UserProfile that inherits from the ProfileBase class and I use this to set custom properties like "FullName". I am wanting to loop through all the users in the database and get access to their profile properties. On each iteration I am calling ProfileBase.Create() to get a new profile and then access the properties. It looks to me like every time ProfileBase.Create() is called it hits my SQL database

“Remember me” with ASP.NET MVC Authentication is not working

假装没事ソ 提交于 2019-12-01 03:11:55
I have a standard ASP.NET MVC (RC Refresh) web project, with the standard ASP.NET Membership provider and the Account controller that is included in the project template. When I check "Remember me" in my Login form, I am still not being remembered by the site. (Firefox remembers my username and password, but what I expected to happen was to be automatically logged on). Do I have to set and check the cookie manually? If so, how should it best be done? Todd Smith You need to pass true/false to the SetAuthCookie method. public ActionResult Login (string email, string password, bool rememberMe,