Ejemplo n.º 1
0
        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            context.OwinContext.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" });

            var user = await _userDbService.AuthenticateUser(context.UserName, context.Password);

            if (user == null)
            {
                context.SetError("invalid_grant", Properties.Resources.Error_AccessDenied);
                return;
            }
            var identity = setClaimsIdentity(user, context.Options.AuthenticationType);

            context.Validated(identity);
        }
Ejemplo n.º 2
0
 public async Task <OrphanageDataModel.Persons.User> Authenticate(string username, string password)
 {
     return(await _userDBService.AuthenticateUser(username, password));
 }