Repeated "PUT Methods" to change PIN fail

Version 1
    This document was generated from CDN thread

    Created by: Laurent TRELET on 12-10-2010 03:14:39 PM
    Hello !
     
    I'm working on an interface to allow users to change their PIN (ASP.NET Interface).
     
    I use a PUT Method to do this and it works fine. But, when i try to execute the same request one little moment after the first one (same userID, same PIN or not), the request fails... 
     
    The UCX server returns me a "Error 400", "Bad Request". I don't really understand because the same request was OK just before...
     
    I have to wait a moment, or relaunch my interface to success in requesting the server again.
     
    Do you have any idea to solve my problem ? 
     
    I try to close() every instances in my code... Here you have a code example if it could help :

    ----------------------------------------------------------------------------
        VSoapBody = "<Credential><Credentials>12345</Credentials></Credential>";
        string putURLSpecific = "https://server/vmrest/users/e4574824-b3cd-4593-ac80-d01abc06d7b2/credential/pin";
                HttpWebRequest req = (HttpWebRequest)WebRequest.Create(putURLSpecific);
                req.AuthenticationLevel = System.Net.Security.AuthenticationLevel.None;
     
                req.Credentials = new NetworkCredential("APIUser", "******");
                req.Method = "PUT";
                req.ContentType = "application/xml";
     
                using (StreamWriter writer = new StreamWriter(req.GetRequestStream()))
                {
                    writer.WriteLine(VSoapBody);
                    writer.Dispose();
                    writer.Close();
                }
     
                WebResponse response = req.GetResponse();
     
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                    {
                        while (reader.Peek() != -1)
                        {
                            Console.WriteLine(reader.ReadLine());
                        }
                        reader.Dispose();
                        reader.Close();
                    }
                    response.Close();                
                }
    ---------------------------------------------------------------------------
     
    Thank you in advance for your answers.
     
    Regards.

    Subject: RE: Repeated "PUT Methods" to change PIN fail
    Replied by: Mayank Sharma on 25-10-2010 06:17:43 PM
    It probably is because Unity Connection is not allowing the password to be changed. For me, it was that the user cannot use the same password used within last 4 tries.
     
    "Password cannot be a repeat of the last 4 passwords."
     
    Try a new password and it should work.
     
    Thanks,
    Max

    Subject: RE: Repeated "PUT Methods" to change PIN fail
    Replied by: Greg Dirst on 04-11-2010 07:30:51 PM
    Basically, you have to look at the response in the HTML to know "why" a 400 was returned.
     
    When you change a password immediately after a successful one then you are probably hitting the 400 password changed too frequently error.
     
    If the password is the same on the second attempt after the  first attempt succeeds then could be getting the 400 repeated credentials prohibited error.