← Back to team overview

launchpad-dev team mailing list archive

Re: Problem using Launchpad API to retrieve the authenticated user

 

On 13/03/13 09:22, Chris Wilson wrote:
> Hi there,
> 
> I'm attempting to build a Launchpad client and have run into a problem
> sending a signed OAuth request to retrieve the authenticated user.
> 
> Every time I send a GET request
> to https://api.staging.launchpad.net/people/+me I get a 401 Unauthorised
> response before the redirect can happen.
> 
> I would have thought there was a problem with my OAuth tokens if,
> whenever I send the exact same request
> to http://www.launchpad.net/people/+me, I didn't get the full HTML page
> for the authenticated user back.

Only api.(qastaging.|staging.)launchpad.net accept OAuth; the webapp
does not. You're probably accidentally authenticating with a cookie instead

> Does this description give anyone any idea what's wrong with my code, or
> would you need to see more of it before knowing for sure?

I suspect you haven't signed the request properly, as that works fine in
launchpadlib:

In [2]: lp.load('/people/+me')
Out[2]: <person at https://api.launchpad.net/devel/~wgrant>

What does your request look like (redacting the sensitive OAuth tokens)?

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References