function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alex_from_75015alex_from_75015 

Oauth 2.0 in Javascript - no answer to final POST request

Hello

I am using a js code to get oauth 2.0 token

Everything is going well except that my final POST request does not get an answer (state 200 but no response !!!)

My redirect uri is "http://localhost/testoauthjs/oauth2/oauth2.html" since I am developing on my PCs

I have try also with an page hosted on force.com in https : no answer

 

Any idea of what might be the problem ?

Thanks for your help

Regards

SurpriseSurprise

Can u check if you have set  the body to send data across?

alex_from_75015alex_from_75015

Hi

What do you mean by set the body ?
As you can see in firebug trace, I am perform a POST request on .../token with body set with client_id...client_secret...

Am I missing something ?

Thanks for your help

Regards

AshwaniAshwani

Hi,

 

First you need to use GET request and this should be through browser. If your status code is OK(200) then you will be redirected to your given redirect url with authorization code. After receiving authorization code then do POST request.

 

Read here : http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com

 

For any doubt reply or mark it as solved if it solved your problem.

 

Thanks.