Example #1
0
 public AuthorizationController(
     IServerOptions serverOptions,
     IHaloUserManager userManager,
     IUserBaseDataRepository userBaseDataRepository,
     ISecureDataFormat <AuthenticationTicket> secureDataFormat)
 {
     _serverOptions          = serverOptions;
     _userManager            = userManager;
     _userBaseDataRepository = userBaseDataRepository;
     _secureDataFormat       = secureDataFormat;
 }
 public AuthorizationController(
     IServerOptions serverOptions,
     IHaloUserManager userManager,
     IUserBaseDataRepository userBaseDataRepository,
     ISecureDataFormat<AuthenticationTicket> secureDataFormat)
 {
     _serverOptions = serverOptions;
     _userManager = userManager;
     _userBaseDataRepository = userBaseDataRepository;
     _secureDataFormat = secureDataFormat;
 }
Example #3
0
        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            IHaloUserManager haloUserManager =
                (IHaloUserManager)context.OwinContext.GetAutofacLifetimeScope().Resolve(typeof(IHaloUserManager));


            // BUG: Find out how this is done via AutoFac
            HaloUser user = await haloUserManager.FindAsync(context.UserName, context.Password);

            if (user == null)
            {
                context.SetError("invalid_login", "The user name or password is incorrect.");
            }
            else
            {
                var identity = new ClaimsIdentity(context.Options.AuthenticationType);
                identity.AddClaim(new Claim("id", user.Id));
                identity.AddClaim(new Claim("username", user.UserName));
                context.Validated(identity);
            }
        }
 public AuthorizationController(IHaloUserManager userManager,
     ISecureDataFormat<AuthenticationTicket> secureDataFormat)
 {
     _userManager = userManager;
     _secureDataFormat = secureDataFormat;
 }
 public UserController(IHaloUserManager userManager, IUserBaseDataRepository userBaseDataRepository)
 {
     _userManager = userManager;
     _userBaseDataRepository = userBaseDataRepository;
 }
 public UserController(IHaloUserManager userManager, IUserBaseDataRepository userBaseDataRepository)
 {
     _userManager            = userManager;
     _userBaseDataRepository = userBaseDataRepository;
 }