[OSM-dev] Using OAuth

Matt Amos zerebubuth at gmail.com
Mon Aug 31 12:22:28 BST 2009


On 8/30/09, Sven Anders <sven at anders-hamburg.de> wrote:
> Am Saturday 29 August 2009 13:42:16 schrieb Tom Hughes:
>> On 29/08/09 12:12, Sven Anders wrote:
>> > How do I get API Access? (For the start i am only interessed in the
>> > mailaddres and the username)
>>
>> You won't be able to get the email address.
>
> I have changed the php api to
> http://code.google.com/p/oauth-php/
>
> and now i was able to get access to the user preferences.
>
> Is it posible to get the username by an api call? Or an other unique
> identifier to store it to my application?

there's an API call to get the user details:

http://api.openstreetmap.org/api/0.6/user/details

which includes the user's display name. it might be a good idea to add
the user ID in there, though, because the display name can be changed.

> Perhabs someone could add a username and mailaddress api call?

user display name is available in the previous API call. the user's
email address will not be available. please see our privacy policy for
more information.

http://wiki.openstreetmap.org/wiki/Privacy_Policy#Email_Addresses

> Also:
> GET /api/0.6/user/account/picture
> GET /api/0.6/user/account/languages
> GET /api/0.6/user/account/description

we could add these to the user details call. the picture and
description are on the user's public page, so there's no problem
there. not sure about the languages.

> GET /api/0.6/user/account/position/lat
> GET /api/0.6/user/account/position/lon

the user's home location is available in the details API call.

> I saw that my user account is having much tokens, because my application is
> always creating a new one, when the user want to have access to my app, as
> the user is not loggin in at my aplication I can not find a older token in
> my
> database.

store the token in a cookie or other session variable?

> Is there a good reason why one user should have more than one access token
> for
> one application?

not really.

cheers,

matt




More information about the dev mailing list