Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
OAuth Authentication Failure: Token retrieval returns "Invalid API Version".
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
djangok  
View profile  
 More options Nov 18 2011, 2:25 pm
From: djangok <kevincheval...@gmail.com>
Date: Fri, 18 Nov 2011 11:25:31 -0800 (PST)
Local: Fri, Nov 18 2011 2:25 pm
Subject: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".
I am able to retrieve the temporary code with /api/oauth/2.0/
authorize/

When I try to retrieve the Access Code from /api/oauth/2.0/
access_token/, I receive HTTP 400: Invalid API Version.

I've checked to make sure the format was correct.  I tried it with
curl on the command line, and with the python code supplied by Disqus.
(https://github.com/disqus/disqus-api-demos/tree/master/comments)
Both return the same response.

So, some questions:
1. How long does the temporary code last?  10 secs, 10 mins?  Does it
time out while I format the request by hand?  (I'm just testing right
now.)
2. Is there a problem with the server code at Disqus that is
generating this request?
3. How long are the access tokens good for?  I would really like to
allow the Users to authorize my app forever.  I can't make them
authorize the app every time they log in.

Kevin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael HP  
View profile  
 More options Nov 19 2011, 6:23 am
From: Michael HP <wus...@gmail.com>
Date: Sat, 19 Nov 2011 12:23:56 +0100
Local: Sat, Nov 19 2011 6:23 am
Subject: Re: [disqus-dev] OAuth Authentication Failure: Token retrieval returns "Invalid API Version".
i don't have documentation, but during bug testing i halted the
access_token request for at least 20 seconds before successfully
sending it, i'd imagine the code is valid for a little while longer
than that, but that really shouldn't be an issue.

regarding question 3, you should read the documentation a bit
more(http://disqus.com/api/docs/auth/#response), the tokens are valid
for 30days, but you can make an automated process that use the refresh
token to request a new access_token without the user knowing.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
djangok  
View profile  
 More options Nov 21 2011, 12:03 am
From: djangok <kevincheval...@gmail.com>
Date: Sun, 20 Nov 2011 21:03:31 -0800 (PST)
Local: Mon, Nov 21 2011 12:03 am
Subject: Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".
Ok, thank you for the response.

The Invalid API Version error went away.  Authentication works
perfectly now.

I am encountering an error when trying to use the refresh request you
pointed out to me.

If I try to make a request like the documentation specifies, the API
refuses it, saying redirect_uri is a missing parameter.

If I give it the same redirect_uri as the rest of my authentication
system, it redirects with ?error=unsupported_response_type appended to
the end.

If I pass it response_type=code, then it returns the regular "Would
you like to authorize this app to edit your Disqus forum" page, which
isn't good.

Is there a response type that I should pass into the GET request that
I don't know of?

Kevin

On Nov 19, 5:23 am, Michael HP <wus...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
djangok  
View profile  
 More options Nov 21 2011, 12:16 am
From: djangok <kevincheval...@gmail.com>
Date: Sun, 20 Nov 2011 21:16:02 -0800 (PST)
Local: Mon, Nov 21 2011 12:16 am
Subject: Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".
OK, finally figured out the problem.

The documentation for token refresh is wrong on two points.

1. POST to https://disqus.com/api/oauth/2.0/access_token/ NOT GET to
https://disqus.com/api/oauth/2.0/authorize/
2. You must pass client_secret, along with grant_type, client_id, and
refresh_token.

Hopefully the doc can be updated so others won't be confused.

On Nov 20, 11:03 pm, djangok <kevincheval...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Cramer  
View profile  
 More options Nov 21 2011, 12:23 am
From: David Cramer <dcra...@gmail.com>
Date: Sun, 20 Nov 2011 21:23:32 -0800
Local: Mon, Nov 21 2011 12:23 am
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

We'll definitely get that corrected. Thanks!
--
David Cramer
http://disqus.com/zeeg
http://twitter.com/zeeg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vinney K  
View profile  
 More options Jun 29 2012, 5:33 pm
From: Vinney K <vinn...@live.com>
Date: Fri, 29 Jun 2012 14:33:12 -0700 (PDT)
Local: Fri, Jun 29 2012 5:33 pm
Subject: Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

Sorry to nudge an old post but I just can't seem to be able to make the
access_token request work and I'm at a loss... I'm sending a post similar
to:

POST
https://disqus.com/api/oauth/2.0/access_token/?client_id=...&grant_ty...

I keep receiving the error: *Missing required parameter: grant_type*

Did you ever experience this issue? If so, can you share your solution?

Thanks,
Vinney


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anton Kovalyov  
View profile  
 More options Jun 29 2012, 6:01 pm
From: Anton Kovalyov <an...@disqus.com>
Date: Fri, 29 Jun 2012 15:01:23 -0700
Local: Fri, Jun 29 2012 6:01 pm
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

Hey,

You need to send these params in your POST body not as a query string. Sorry about confusion.

Anton


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vinney K  
View profile  
 More options Jun 29 2012, 7:44 pm
From: Vinney K <vinn...@live.com>
Date: Fri, 29 Jun 2012 16:44:09 -0700 (PDT)
Local: Fri, Jun 29 2012 7:44 pm
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

I have been trying that as well but, as you had first reported, when I
remove all elements from the querystring, I get the invalid api version
error. I've tried playing with different configurations where some elements
are in the querystring and others are in the body but nothing has worked so
far. Do you happen to remember what you did to make the api version
error go away?

Also, does the content type matter? application/json vs.
application/x-www-form-urlencoded vs. ....

Thanks!
Vinney


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vinney K  
View profile  
 More options Jul 3 2012, 2:24 am
From: Vinney K <vinn...@live.com>
Date: Mon, 2 Jul 2012 23:24:50 -0700 (PDT)
Local: Tues, Jul 3 2012 2:24 am
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

Still having trouble with this. I'm testing with Fiddler using the
following:

POST https://disqus.com/api/oauth/2.0/access_token/ HTTP/1.1

Request headers:
User-Agent: Fiddler
Host: disqus.com
Content-Type: application/json
Content-Length: 254
Request Body:
{ client_id = ..., client_secret = ..., grant_type = authorization_code,
redirect_url = http://mysite.com, code = ... }

The error returned is:

{"error_description": "Missing required parameter: grant_type", "error":
"invalid_request"}

I'm literally about to give up hope on Disqus if I can't get this issue
resolved within the next day or so. Support is slow at best and the
documentation appears to be incorrect. This has been a very frusturating
experience.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vinney K  
View profile  
 More options Jul 3 2012, 2:37 am
From: Vinney K <vinn...@live.com>
Date: Mon, 2 Jul 2012 23:37:04 -0700 (PDT)
Local: Tues, Jul 3 2012 2:37 am
Subject: Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

I've also found that if I add all the parameters into the querystring, I
get a different error.

https://disqus.com/api/oauth/2.0/access_token/grant_type=authorizatio...

This produces the "Invalid API version" error. This error occurs whether I
use the POST or GET methods.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Cramer  
View profile  
 More options Jul 3 2012, 3:38 am
From: David Cramer <dcra...@gmail.com>
Date: Tue, 3 Jul 2012 09:38:47 +0200
Local: Tues, Jul 3 2012 3:38 am
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

You're not constructing correct HTTP requests.

We currently have a catch-all for /api/* that will go to our API controller, which is why you're seeing Invalid API version.

The authorize code request should look like the following:

POST https://disqus.com/api/oauth/2.0/access_token/

And contain a body like this:

       grant_type=authorization_code&
       client_id=PUBLIC_KEY&
       client_secret=SECRET_KEY&
       redirect_uri=http://www.example.com/oauth_redirect&
       code=CODE

--
David Cramer

twitter.com/zeeg
disqus.com/zeeg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marcor  
View profile  
 More options Jul 3 2012, 10:07 am
From: Marcor <marco...@gmail.com>
Date: Tue, 3 Jul 2012 07:07:59 -0700 (PDT)
Local: Tues, Jul 3 2012 10:07 am
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

Now I'm using this code:

...
client.DefaultRequestHeaders.Authorization =
System.Net.Http.Headers.AuthenticationHeaderValue.Parse("Basic " + base64);
var postData = new List<KeyValuePair<string, string>>();
postData.Add(new KeyValuePair<string, string>("grant_type", "password"));
postData.Add(new KeyValuePair<string, string>("client_secret",
App.SECRETKEY));
postData.Add(new KeyValuePair<string, string>("client_id", App.APIKEY));
postData.Add(new KeyValuePair<string, string>("scope", "read,write"));
HttpContent content = new FormUrlEncodedContent(postData);
HttpResponseMessage res = await
client.PostAsync("https://disqus.com/api/oauth/2.0/access_token/", content);

and the response is:
{"error_description": "Unallowed grant type: password", "error":
"invalid_grant"}

i'm following "Request Access Token" from here:
http://disqus.com/api/docs/auth/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Cramer  
View profile  
 More options Jul 3 2012, 10:17 am
From: David Cramer <dcra...@gmail.com>
Date: Tue, 3 Jul 2012 16:17:12 +0200
Local: Tues, Jul 3 2012 10:17 am
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

So you'd have to have an account with password auth enabled to use it. Currently this requires you to submit an application describing
your use case, and we review it and approve it on a case-by-case basis.

--
David Cramer

twitter.com/zeeg
disqus.com/zeeg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marcor  
View profile  
 More options Jul 3 2012, 10:20 am
From: Marcor <marco...@gmail.com>
Date: Tue, 3 Jul 2012 07:20:30 -0700 (PDT)
Local: Tues, Jul 3 2012 10:20 am
Subject: Re: [disqus-dev] Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

Explain to me the procedure please. Where can I submit the application use
case?

Il giorno marted́ 3 luglio 2012 16:17:12 UTC+2, David Cramer ha scritto:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Subangkit Ramadiputra  
View profile  
 More options Jul 16 2012, 5:12 am
From: Subangkit Ramadiputra <subangkit.ramadipu...@kiranatama.com>
Date: Mon, 16 Jul 2012 02:12:34 -0700 (PDT)
Local: Mon, Jul 16 2012 5:12 am
Subject: Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

I've same problem to get access_token

$oauth2token_url = 'https://disqus.com/api/oauth/2.0/access_token/';
$redirect_uri =
'http://community.git.local/sites/all/libraries/disqus-php/oauth.php';
$clienttoken_post = array(
    "grant_type" => 'authorization_code',
    "client_id" => $public_key,
    "client_secret" => $secret_key,
    "redirect_uri" => $redirect_uri,
    "code" => $code
);

$curl = curl_init($oauth2token_url);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $clienttoken_post);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$json_response = curl_exec($curl);
curl_close($curl);

But didn't work and give me error message

invalid parameter: code


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »