Exemple #1
0
        public async Task <bool> Register(UserRegisterDto userRegisterDto)
        {
            var result = await mKeycloakClient.CreateUserAsync(mRealmName, new User
            {
                FirstName   = userRegisterDto.FirstName,
                LastName    = userRegisterDto.LastName,
                UserName    = userRegisterDto.Username,
                Email       = userRegisterDto.Email,
                Credentials = new List <Credentials>
                {
                    new Credentials
                    {
                        Type      = "password",
                        Value     = userRegisterDto.Password,
                        Temporary = false
                    }
                }
            });

            return(result);
        }
 public Task <bool> AddUserAsync(User user)
 {
     return(_client.CreateUserAsync(_context.ConnectionSettings.Realm, user));
 }