locked
Request to acess to OneDrive/Javascript RRS feed

  • Question

  •  I am tryint to write a request to get access token on JS.

    var client=" "; //here is my client id

    var secret=" "; //here is my application secret code

    var uri= " "; //here is my redirect URI

    var strFileURL = "https://login.live.com/oauth20_token.srf";
       var objHTTP = new ActiveXObject("MSXML2.XMLHTTP");
       objHTTP.open("POST", strFileURL, false);
       objHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
       objHTTP.send("client_id="+client+"&redirect_uri="+uri+"&client_secret="+secret+"&code=CvHEEK5cpdYnXIVSksSwHiQGIeBfrM1JIKRlDrNPu%21izflwLSjcn5vjfUCfnSdn%21RAABr9M1Puim0gEgYpuXQdBWdIu2IALbGGAY8u42kLltge2rPC8Ks7c5EHY2moNBvWzXvLBs%2a2g87anSP9a3A9i64bA2dDYMcKmJtAzcImQ22jABewpKYVba2PPYBfKohr55T1QbqqUza%21mbOYlvK5q3jjGPwcddUgd42cA%2axSAPtH61nYL23SMZHmIshNjeG1TFqApDMke%2aLEytrLOWdegvVYppk58DZf1rT0Z6LJHvowBFCLFvIRHg3tyVJp4JcvK6X9EPR4TrBtGAzdH1RTpg8gr7%2ahl8R2S7lIBREtXG&grant_type=authorization_code"); 
       t= objHTTP.responseText;;
       Log.Message(t);

    On executing a request I get: server error.

    What I am doing wrong?


    Monday, April 21, 2014 12:27 PM

All replies

  • Can you provide a Fiddler trace?  What are you seeing in the body of the response?

    Carl Hirschman

    Monday, April 21, 2014 6:22 PM
    Moderator