No callback after authorizing

10 views
Skip to first unread message

trancealot

unread,
Feb 24, 2011, 9:24:27 PM2/24/11
to misoapi
Hello, I'm having an issue with the authorization. After gettting to
the "Authorize access to your account" page, clicking the Authorize
button just displays a page with the following text. It should
redirect to my callback page shouldn't it?

You've granted Journamatic access to interact with your account!
Feel free to find start interacting at Journamatic to get started.

Nathan Esquenazi

unread,
Feb 25, 2011, 1:04:07 AM2/25/11
to mis...@googlegroups.com
This happens when you don't pass in a callback_url into the oauth authorization process. Did you pass a callback url as part of the request?

trancealot

unread,
Feb 25, 2011, 1:01:38 PM2/25/11
to misoapi
Yes I am passing in a "oauth_callback" parameter to the
authorization. I've tried it with GET and POST and still the same
issue.

I get back a response like this from the authorization, then click the
Authorize button, but get stuck on that screen.

oauth_token=[token]&oauth_token_secret=[secret]&oauth_callback_confirmed=true

Nathan Esquenazi

unread,
Feb 25, 2011, 7:49:27 PM2/25/11
to misoapi
You need to pass the oauth_callback to the *request_token* request as
per the Oauth 1.0a spec:

http://oauth.net/core/1.0a/#auth_step1

Basically make sure to include the oauth_callback properly into the
initial request token parameters. The reason you wouldn't get the
callback redirect is because you are not passing the callback_url into
the appropriate step. Let me know if that helps.

Paul Calabro

unread,
Feb 26, 2011, 9:14:49 AM2/26/11
to mis...@googlegroups.com, Nathan Esquenazi
An example of including the oauth_callback url into the initial request token parameters would be:
        //############################
//# FETCH REQUEST TOKEN ##
//#############################
try { 
$consumer = new HTTP_OAuth_Consumer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET);
$consumer->getRequestToken(OAUTH_REQUEST_TOKEN_API,CALLBACK_URL);
  $_SESSION['request_token'] = $consumer->getToken();
  $_SESSION['request_token_secret'] = $consumer->getTokenSecret();
}catch (Exception $e) {
echo 'Fetching Request Token Exception: ',  $e->getMessage(), "\n"; 

//###################################################
// REDIRECT THE USER TO THE AUTHORIZATION URL #
//###################################################
try { 
$url = $consumer->getAuthorizeUrl(OAUTH_AUTHORIZE_API);
header("Location:".$url);
}catch (Exception $e) {
echo 'Authorization URL Redirection Exception: ',  $e->getMessage(), "\n"; 

Paul Calabro

unread,
Feb 26, 2011, 9:32:39 AM2/26/11
to mis...@googlegroups.com, Nathan Esquenazi
The important lines in that process being:

$consumer = new HTTP_OAuth_Consumer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET);
$consumer->getRequestToken(OAUTH_REQUEST_TOKEN_API,CALLBACK_URL);


trancealot

unread,
Feb 27, 2011, 11:20:43 AM2/27/11
to misoapi
Thanks, got it working now. The c# library I was using didn't support
the oauth_callback even though I was including it in the querystring.
I'm using a version now which supports OAuth 1.0a and everything is
working as expected now, thanks!

On Feb 26, 6:32 am, Paul Calabro <pcala...@gmail.com> wrote:
> The important lines in that process being:
>
>  $consumer = new HTTP_OAuth_Consumer(OAUTH_CONSUMER_KEY,
> OAUTH_CONSUMER_SECRET);
> $consumer->getRequestToken(OAUTH_REQUEST_TOKEN_API,CALLBACK_URL);
>

Nathan Esquenazi

unread,
Feb 27, 2011, 6:27:04 PM2/27/11
to mis...@googlegroups.com
Glad to hear it. Let us know if you have any other issues.

-- 
Nathan Esquenazi
Lead Platform Engineer
Miso (gomiso.com)

Reply all
Reply to author
Forward
0 new messages