pear / Services_Openstreetmap

Makes communicating with the Open Street Map API, and Nominatim, from PHP intuitive.
https://pear.php.net/package/Services_OpenStreetMap/
BSD 3-Clause "New" or "Revised" License
200 stars 53 forks source link

Support for Oauth2 #231

Open sascha-hendel opened 1 month ago

sascha-hendel commented 1 month ago

Extended code to support OAuth2. Two files are changed:

  1. https://github.com/sascha-hendel/Services_Openstreetmap/blob/master/Services/OpenStreetMap/Config.php
  2. https://github.com/sascha-hendel/Services_Openstreetmap/blob/master/Services/OpenStreetMap/Changeset.php

New config 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.