custom-membershipprovider

ASP.NET MVC 4 and dynamically changing membership connection string with CodeFirst

怎甘沉沦 提交于 2020-01-01 19:28:40
问题 I am working on creating a MVC4 multi-tenant site that uses seperate DBs for each tenant and have been trying to get the membership piece to work for each tenant without any luck. For some reason connectionStringField is always null no matter what I do. Any ideas why this could happen? public class CodeFirstMembershipProvider : MembershipProvider { public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { base.Initialize(name, config); // hard

Property injection in custom membership provider using Castle

给你一囗甜甜゛ 提交于 2019-12-29 09:04:25
问题 So far in reading about possibilities of injection to custom membership providers, I've found two possible ways to do it: One is the following: http://bugsquash.blogspot.com/2010/11/windsor-managed-membershipproviders.html Here the author basically suggests to register your custom provider and then have a rather questionable windsor adapter for membership (I don't really like the way in which it instances your provider using a container it gets from HttpApplication , which it ultimately wraps

Why does login redirect fail in MVC when using a FormsAuthentication CustomIdentity and updating AuthTicket UserData?

*爱你&永不变心* 提交于 2019-12-25 02:46:06
问题 Using forms authentication, I am filling the UserData field with a serialized CustomIdentitySerializer object. The user logs in, and I have verified that Membership.ValidateUser() works just fine. I then begin populating the CustomIdentitySerializer object and send it off to a static UpdateAuthenticationTicket method in a static UserContext class to test data retention - After Login() / User.Identity.IsAuthenticated: // set auth ticket UserContext.UpdateAuthenticationTicket(user.Username,

How to inject repositories into a custom MembershipProvider?

ぃ、小莉子 提交于 2019-12-24 08:42:51
问题 It seem i can't get this to work. I made a custom MembershipProvider and i want to inject a repository inside but the [Inject] property just doesnt work. public class PyrosphereMembershipProvider : MembershipProvider { [Inject] protected IDepositoireUtilisateur DepositoireUtilisateur { get; set; } [Inject] protected IDepositoireProfile DepositoireProfile { get; set; } ... I think this is because this class are created way before the MVC application is running which cause the actual problem. I

How to inject repositories into a custom MembershipProvider?

孤者浪人 提交于 2019-12-24 08:40:01
问题 It seem i can't get this to work. I made a custom MembershipProvider and i want to inject a repository inside but the [Inject] property just doesnt work. public class PyrosphereMembershipProvider : MembershipProvider { [Inject] protected IDepositoireUtilisateur DepositoireUtilisateur { get; set; } [Inject] protected IDepositoireProfile DepositoireProfile { get; set; } ... I think this is because this class are created way before the MVC application is running which cause the actual problem. I

How can you inject an asp.net (mvc2) custom membership provider using Ninject?

北城以北 提交于 2019-12-21 18:58:08
问题 OK, so I've been working on this for hours. I've found a couple of posts here, but nothing that actually resolves the problem. So, let me try it again... I have an MVC2 app using Ninject and a custom membership provider. If I try and inject the provider using the ctor, I get an error: 'No parameterless constructor defined for this object.' public class MyMembershipProvider : MembershipProvider { IMyRepository _repository; public MyMembershipProvider(IMyRepository repository) { _repository =

The user name or password provided is incorrect. in MVC 3 Internet Application

不问归期 提交于 2019-12-11 18:51:17
问题 I have a " Internet Application " - " A default ASP.NET MVC 3 project with an account controller that uses forms authentication. " called MyMv3App . I run the site in IIS Express using Ctrl + F5 and then I go to localhost:10382/Account/Register and I create a user " test1 ". Once the user is created I'm redirected to the Home page. I log off. Then I go to localhost:10382/Account/LogOn and type the username and password for the user "test1" and click on "Log On" button and the user is logged

ASP.net Custom membership on top of quality center authorization

谁都会走 提交于 2019-12-11 17:58:32
问题 I am relatively new to authorization/memberships in asp.net, so pls excuse if I ask anything silly. I have been looking at lot of examples to implement a custom membership provider in .net (in stackoverflow, codeproject, devX, and www.asp.net) and coded based on that but somehow couldn't get it working. My requirement - our organization heavily uses HP's Quality center(QC), I am developing an asp.net application, its login page will use QC'a API for authenticating a user. I also have a SQL

Custom Membership Provider won't redirect

拥有回忆 提交于 2019-12-11 05:08:55
问题 I have setup a custom membership and role provider that is not currently working as it should. I suspect that I have missed something but with all my research I have not been able to work out what it is. The problem that is occurring is that when I enter the correct login details the login page reloads rather than redirecting. I suspect that it is redirecting but for some reason it doesn't recall that the authorisation has been approved, so as a result it sends the user back to the login page

Error after update Autofac.Mvc5 from 3.3.2 to 3.3.3

你离开我真会死。 提交于 2019-12-11 02:44:36
问题 I have a Error after update Autofac.Mvc5 from 3.3.2 to 3.3.3 I posted my issue to github https://github.com/autofac/Autofac/issues/572#issuecomment-63236738 and got response that I need to ask here :) Below my situation: What I have: // Setup DI as default MVC controller factory DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); I need this to use in injected property of Custom Membership Provider protected IMembershipService MembershipService { get { return