-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
Add OpenStreetMap OAuth2 backend #758
Comments
Adding link to upstream OSM operations issue for better visibility: openstreetmap/operations#867 OSM's OAuth 1.0a is in the process of being deprecated, as discussed at openstreetmap/operations#867. No timeline has been set, but we do not expect to shut off OAuth 1.0a this year. It would be good to move to OAuth 2.0 well before this time. |
Now we have a timeline for the OAuth 1.0a shut down: the 1st of June, with brownouts starting on May 1st. |
I've started to create a new OAuth2 config for OpenStreetMap: https://github.com/mmd-osm/social-core/tree/feat/osmoauth2 Will create a Pull request once someone could give it a try and report back if it works. Thanks! |
Test run:Run demo:
Preparation steps:Register new app on osm.orgOn osm.org: register new application https://www.openstreetmap.org/oauth2/applications Permissions: Read user preferences (read_prefs) Note down client id and client secret values, since they're needed for the next step. Maintain local settingsCreate new file example-django/example/local_setings.py:
|
* [feat] Add OAuth2 support for OpenStreetMap Fixes #758 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
By the way, OpenStreetMap also supports OIDC since last year, so that would also work. |
@mmd-osm will it be possible to share code snippet or github url for the project you used as sample in gif attached on above comment ? |
@kshitijrajsharma : yes, sure, you can find it over at: https://github.com/python-social-auth/social-examples |
@mmd-osm so login url will be |
Since the name of the backend has changed to openstreetmap-oauth2, the /login/ URL is probably matching the new name. TBH, I haven't entered that URL anywhere, just starting the demo on http://127.0.0.1:8001 and then hitting the different log on buttons. |
By the way, one thing to keep in mind for testing, social-auth release 4.5.2 doesn't include the new openstreetmap-oauth2 backend yet. You would need to use the master branch in this repo. I hope we will see a new 4.5.3 release in the upcoming weeks. |
@mmd-osm Yes , I am building it from master right now ! I am trying to test the new change, I will let you know how it goes ! |
@mmd-osm it works well ! Thanks for this And yes the login url will be |
@yohanboniface If you can prepare pull request for the release, it would make it easier. It is documented at https://github.com/python-social-auth/social-core/wiki/Release-process |
Cool! Here you go #885 :) |
Proposed feature
Make it possible to authenticate using an OpenStreetMap account using OAuth 2.
Status quo
An OpenStreetMap backend exists in python-social-auth, but only for OAuth 1.0 and OAuth 1.0a, not yet for OAuth 2.
OpenStreetMap acts as a provider for OAuth 1.0a and OAuth 2.0 and recommends the latter for any new applications. Relevant parameters for OAuth 2.0 are documented on the OSM wiki, currently:
Supported Grant types:
Add authorization data to Request Headers
Production (this is the one we want):
Development (should maybe be a separate python-social-auth backend?):
Supported scopes:
read_prefs
: read their user preferenceswrite_prefs
: modify their user preferenceswrite_diary
: create diary entries, comments and make friendswrite_api
: modify the mapread_gpx
: read their private GPS traceswrite_gpx
: upload GPS traceswrite_notes
: modify notesAny other comments?
(none)
The text was updated successfully, but these errors were encountered: