Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: LWP::Authen::OAuth2 terminology

by perlfan (Vicar)
on Sep 03, 2020 at 02:34 UTC ( [id://11121311]=note: print w/replies, xml ) Need Help??


in reply to LWP::Authen::OAuth2 terminology

>But will they or I be the user?

You are the user (consumer, client).

Look at the curl example on your provider's site. It's about as basic as one can get. The constructor for LWP::Authen::OAuth2 requires the information that is needed for the request_token call, which is how you actually authenticate the client (instance of LWP::Authen::OAuth2). The instance (client) will then utilize the token when making calls via get, post, etc.

Most of the complication is actually on the provider's end in facilitating the "conversation" that generates the token and sets access controls; but this is all done on the provider's end. LWP::Authen::OAuth2 is for the one making the API calls (you).

Update - not sure, but looks like there are some service specific provider modules, e.g., LWP::Authen::OAuth2::ServiceProvider::Dwolla. So I am not sure if it's ready to roll out of the box or it just provides a foundation for something whacky a provider might do. Good luck.

Replies are listed 'Best First'.
Re^2: LWP::Authen::OAuth2 terminology
by cormanaz (Deacon) on Sep 04, 2020 at 16:31 UTC
    You were right @perlfan. It was easy, and I was able to do it using LWP::UserAgent rather than implementsing LWP::Authen::OAuth2. I only thought I had to do the later because they recommended using a standard library for the OAUTH transactions so I thought it was more complicated. I stand by my rants about OAUTH2 tho :-)
Re^2: LWP::Authen::OAuth2 terminology
by cormanaz (Deacon) on Sep 03, 2020 at 14:59 UTC
    But wait, user is not the same as consumer according to that primer. That is what's so confusing about this. OAuth2 seems to be designed for the case where I write an app that someone else will use to access a provider's data. I just want to get data from the API myself, so I guess that collapses I and someone else. But then I have to somehow authorize myself to get the data, as if I were not me? If perlmonks had emojis, I would totally insert that exploding head one right here.
      Have you even tried the curl command to get the auth token from them? It seems like if you signed up, got a "secret", and made that call you'd be 90% there. Are you on Windows or something and don't have a decent commandline?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11121311]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found