Exemplo n.º 1
0
        public async Task <AuthTokens> AuthenticateAsync(AuthenticationData data)
        {
            Validate.NotNull(data, "Authentication data");

            var user = await FindAppUserAsync(x => x.Username == data.Username);

            var enc = cs.EncryptPassword(data.Password);

            if (enc != user.PasswordHash)
            {
                throw new Exception("Passwords are not match");
            }

            return(GenerateTokens(user));
        }
Exemplo n.º 2
0
 public static string EncryptPassword(string stringToConvert)
 {
     return(_currentCryptographyService.EncryptPassword(stringToConvert));
 }