Well, should anyone stumble across this thread in the future looking for help, the answer is "oob".

Each site apparently makes up their own term for redirect_uri when being accessed from an application instead of a webserver. For Yahoo it's "oob", for google it's "urn:ietf:wg:oauth:2.0:oob"

One other thing to be aware of, if you're using LWP::Authen::OAuth2 and it's not one of the 4 sites natively supported, you need to find the authorization and token endpoint addresses and declare them when you make your oauth2 object.

At this point I'm able to summon an Authorization Code, however when attempting to exchange it for a token I'm getting

"OAuth2 error: INVALID_INPUT Description: Redirect URL cannot be empty for authorization_code grant type at C:\Sustaining\Perlinprogress\Football\oauth.pl line 105."

my $oauth2 = LWP::Authen::OAuth2->new( authorization_endpoint => 'https://api.login.yahoo.com/oauth2/requ +est_auth', token_endpoint => 'https://api.login.yahoo.com/oauth2/get_token', client_id => '****', client_secret => '****', scope => 'fspt-w', redirect_uri => 'oob', ); my $url = $oauth2->authorization_url(); my $code = prompt('x', 'Paste the code obtained at the above URL here: + ', '', ''); # Exchange the code for an access token: my $token = $oauth2->request_tokens(code => $code) or die; # If we get to here, it worked! Report success: print "\nToken obtained successfully!\n"; print "Here are the token contents (just FYI):\n\n"; print $token->to_string, "\n";

In reply to Re: Oauth2 help needed by superwombat
in thread Oauth2 help needed by superwombat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.