Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oauth 2.0? #229

Open
dddesign opened this issue May 3, 2024 · 3 comments
Open

Oauth 2.0? #229

dddesign opened this issue May 3, 2024 · 3 comments

Comments

@dddesign
Copy link

dddesign commented May 3, 2024

is oauth 2.0 supported? if so, can someone give me an example code?
if not, this would be very important!!!

check here:

Please note the Future deprecation of HTTP Basic Auth and OAuth 1.0a announcement: https://www.openstreetmap.org/user/pnorman/diary/401157

March 1st, 2024: New OAuth 1.0a application registrations are disabled. Existing applications will not be impacted. HTTP Basic Auth will not be impacted.
May 1st, 2024: Sysadmins will start brownouts to find applications that are still using OAuth 1.0a or HTTP Basic Auth
June 1st, 2024: OAuth 1.0a and HTTP Basic Auth will be shut down.

https://community.openstreetmap.org/t/oauth-1-0a-and-http-basic-auth-shutdown/108490

@sascha-hendel
Copy link
Contributor

Hi dddesign,

forked the library and extended code to support OAuth2. Two files are changed:
https://github.com/sascha-hendel/Services_Openstreetmap/blob/master/Services/OpenStreetMap/Config.php
https://github.com/sascha-hendel/Services_Openstreetmap/blob/master/Services/OpenStreetMap/Changeset.php
On init You need to provide parameter oauth2_token:
$config = array( 'oauth2_token' => 'YOUR_OAUTH2_TOKEN', ... further parameters ); $osm = new Services_OpenStreetMap($config);

The routines to obtain OAuth2 authorization code and in second step the token are not included. Therefore You need to use an OAuth2 library or write your own code.

Hope this helps. My patched library files are in testing stage. If You find an error, please give me a note. I will invoke a pull request to the master branch if things work well after a while.

@dddesign
Copy link
Author

dddesign commented Jul 7, 2024

thanks, working great!

@mnalis
Copy link

mnalis commented Jul 8, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants