Example #1
0
        public async Task <PulseIdentityUser> FindByUsernameAsync(string userName)
        {
            var result = await _userManager.FindByNameAsync(userName);

            if (result == null)
            {
                throw new Exception("Can not found user with username: " + userName);
            }

            return(result);
        }
Example #2
0
        public async Task <string> GenerateHeaderAsync(string userName)
        {
            var user = await _userManager.FindByNameAsync(userName);

            return(Convert.ToBase64String(Encoding.ASCII.GetBytes(user.ClientId + ":" + user.SecretKey)));
        }