Beispiel #1
0
        public void ChangePassword(Guid userId, string newPassword, string oldPassword)
        {
            VcapRequest.BuildRequest(HttpMethod.Post, ContentTypes.FormUrlEncoded, Constants.Password, Constants.Score);
            VcapRequest.AddBodyParameter("password", newPassword);

            var score        = new { score = 0, requiredScore = 0 };
            var responceInfo = VcapRequest.ExecuteAnonymousType(score);

            //TODO: need additional info how to handle previous responce

            ScorePassword(userId, newPassword, oldPassword);
        }
Beispiel #2
0
        public Guid Create(string username, IEnumerable <string> arrayEmails, string passwd, string firstName, string lastName)
        {
            VcapRequest.BuildRequest(HttpMethod.Post, ContentTypes.Json, Constants.UserUaa);

            var listEmails = BuildingEmails(arrayEmails);
            var user       = new
            {
                userName = username,
                emails   = listEmails,
                password = passwd,
                name     = new { givenName = firstName, familyName = lastName }
            };

            VcapRequest.AddBodyParameter(EntityName, user);

            var tempUser = new { id = Guid.Empty };

            return(VcapRequest.ExecuteAnonymousType(tempUser).id);
        }