Move OSM authentication to OAuth 2.0 #6144
Closed
opened 2023-09-27 07:36:12 +00:00 by pnorman
·
26 comments
No Branch/Tag specified
master
weblate-i18n
pastk-data
github/fork/AndrewShkrob/android-auto/car-location
ios/pp-for-track-recording
redauburn-patch-1
ios/route-preview-redesign
rt-android-splashscreen-android12
geojson-support
github/fork/Raghaddahi/fix/1566-url-class-bugs
github/fork/rebustj/fix/coredata-crashes
github/fork/hemanggs/zoom-button-fix
github/fork/hemanggs/styles-poi
github/fork/AndrewShkrob/ci/cmake-workflow
beta/ios-hotfix-search
github/fork/sddzhyc/master
ios/search-fix-to-child-vc
github/fork/savsch/feat/android-modal-search
github/fork/RedAuburn/temp-auto-fix
github/fork/RedAuburn/rework-theme-system
github/fork/rimas-kudelis/sound-strings-lt
github/fork/coderang-gk/feature-homescreen-widget-bookmark
github/fork/AndrewShkrob/android/sdk-om
github/fork/FedericoCeratto/reuse-sbom
github/fork/gpesquero/my_location
github/fork/DevarshVasani/DownloadingError-Message
github/fork/DevarshVasani/handle-surface-destruction
github/fork/Strubbl/Strubbl-patch-1
github/fork/RedAuburn/mastodon-bluesky
github/fork/CrazyStevenz/patch-2
ios/update-toast-ui
pastk-generator-genorder
pastk-autogen-subways
github/fork/meenbeese/integrate-sonarcloud
github/fork/dmitrygribenchuk/localization_cleanup
github/fork/coderang-gk/android-transparent-navbar-light-mode
ios/add-icons-to-the-live-activity-widget
github/fork/hemanggs/parse-coordinate-links
github/fork/gpesquero/intermediate_points
ios/fix-search-on-map-tests-for-ipad
release/2025.03.02
github/fork/RedAuburn/always-update-fast
pastk-drape-subways-greying-out
ios/update-search-vc-ui
github/fork/Isira-Seneviratne/AudioManagerCompat
alpha/2025.02.23
crowdin-master
l10n
github/fork/soshial/generate-taginfo-json
github/fork/DeshDeepakKant/ui/improve-description-display-9943
github/fork/hemanggs/increase-touch-area
ios/search-ui-redesign
ios/show-new-search-vc-from-the-route-building
release/2025.01.24
github/fork/savsch/fix/android-pp-bookmark-edit-issue2418
github/fork/renderexpert/remove_gles2
github/fork/Osyotr/windows-unittests
github/fork/AndrewShkrob/android/world-maps-for-all-flavors
github/fork/RedAuburn/splashscreen-android12
drop-appstream-glib
separate-locationservice-lib
github/fork/gpesquero/remove_speed_display
github/fork/zeac/feature/1
github/fork/DeshDeepakKant/fix/building_levels_hint
github/fork/gpesquero/route_plan
github/fork/IsiGebauer/StylingMtbTrails
github/fork/DeshDeepakKant/Mobile-Internet-Settings
release/2025.01.12
github/fork/AndrewShkrob/actions/cpp-codestyle-check
github/fork/AndrewShkrob/clang-format
int/anrdoid-auto/permissions-screen
rt-docs-release-management-principles
generator-wikipedia
generator-actions
generator-subways
ios/enable-cpp-swift-interop
github/fork/map-per/sand
pastk-docs-values
fix-deprecated-atomic-load
rt-docs-communication
rt-docs-collaboration
github/fork/meenbeese/bsdiff
github/fork/meenbeese/karabakh
github/fork/AndrewShkrob/android-auto/location-off
ios/fix-compile-warnings-and-cleanup-unsupported-code
rt-ios-managed-signing
github/fork/IsiGebauer/AllowDirToBeEmpty
ios/fix-ios-test-ci-action-failure
ab-ios-bookmarks-last-category
github/fork/IdeallyGrey/swap-abandoned-disused-rail-rendering
github/fork/meenbeese/atomic-shared-ptr
pastk-docs-teams
qt-3d-preferences
github/fork/TobiPeterG/cur-speed-widget
fix-file-read-exception
fix-track-length-calculation
github/fork/kavikhalique/foreground-crash-fix
github/fork/meenbeese/py-rewrite
pastk-styles-feature-types-migration
release/24.11.27
github/fork/AndrewShkrob/docker/ubuntu-container
alpha/2024.11.26
beta/2024.11.26
github/fork/AndrewShkrob/refactoring/network
github/fork/Ferenc-/cmake-moc-workaround
github/fork/Ferenc-/qt-touchpad-rotate
ab-tests-macro-fixes
ios/track-recording-fifth-bar-button
github/fork/kavikhalique/expand-touch
vng-fix
release/24.11.12
alpha/2024.11.10
vng-langs
github/fork/DevarshVasani/enable-strict-mode
patch-3
release/2024.10.22
alpha/2024.10.22
beta/2024.10.22
github/fork/gpesquero/separators
github/fork/Piaszczysty/route-arrow-fix
place-page-for-tracks-backup
github/fork/RedAuburn/profile-image
github/fork/AndrewShkrob/magic-enums
release/2024.10.08
release/2024.10.04
github/fork/AndrewShkrob/data/resources-refactoring
github/fork/AndrewShkrob/data/move-fonts
github/fork/AndrewShkrob/core/autogenerate-translations
github/fork/shakhat/feature-#7358
alpha/2024.10.01
vng-search
github/fork/gpesquero/drape_locale
beta/2024.09.19
release/2024.09.19
rdb-weblate
release/2024.09.08
github/fork/alnzrv/wikimedia-fix
android/speed-limit-exceed-flag
alpha/2024.09.03
alpha/2024.09.03-ios-track-recording-feature
mb-PendingIntent-requestCode-fix
alpha/2024.08.29
add-timestamps-to-track
ab-ios-crash-on-assert
github/fork/dmfrodrigues/place-panel
github/fork/Tmpod/tmpod-alt-routes
github/fork/zyphlar/hyphenate_interpolated_addresses
alpha/2024.08.25-ios-track-recording-feature
alpha/2024.08.29-ios-track-recording-feature
github/fork/cortadocodes/create-reproducible-build-dockerfile
github/fork/dvdmrtnz/taginfo
github/fork/gpesquero/display_next_stop
android/speed-limit-threshold
android-oauth2-with-browser
release/2024.08.17
changes-from-release
release/2024.08.15
alpha-iOS-Bluetooth
github/fork/RedAuburn/dynamic-sidewalk-name
github/fork/Jean-BaptisteC/linkify_desc
github/fork/Jean-BaptisteC/phone_fab
github/fork/Jean-BaptisteC/download_screen
rdb-cldr-plural-order
ab-unused-code
ab-android-location-fix
recent-track-recorder
ab-cleaner-shutdown
localized_address_ordering
github/fork/gpesquero/speed_class
github/fork/Tmpod/task/improve-clangd-support
ab-android-layer-button-highlight
weblate
release/2024.07.08
alpha/2024.07.25-rtsisyk-ios-test
github/fork/willcohen/camp_pitch
ios-implement-the-recently-deleted-support-to-icloud-sync
recently-deleted-categories-using-postfix
fix-ios-simulator-version
github/fork/SRSAS/systemUIMode
github/fork/RedAuburn/collection_times-support
alpha/2024.07.02
github/fork/alkino/atomic_shared_ptr
vng-test-data
github/fork/fgbg03/user_routes_feature
release/2024.06.02
github/fork/j13m126/german-tone
github/fork/eisams/check_date
ios/undo-for-the-bookmark-deletion
ios/restore-bookmark-by-tap-on-the-map
ios/undo-for-the-bookmark-deletion-with-restoring-by-tap-on-the-map
github/fork/beasmm/feature-#5074
github/fork/catalms/add_stop_feature
revert-7969-pastk-drape-transparent-areas
github/fork/kubahaha/boundary_marker-preset
github/fork/fitojb/patch-1
ab-drape-use-constant-base-font-height
rt-beta
github/fork/krozhdestvenski/bookmark_category_select
vng-alt-routes
github/fork/AndrewShkrob/warnings/unused-parameter
pastk-styles-shared-paths-tune-down
android-auto/8015-8019-8022
github/fork/BrianMerino/master
github/fork/gerion0/gentoo-fixes
pastk-beta-0420
pastk-2generate-paths
ab-fix-shaders-rebuild
ios/fix-drape-failure-during-test-running
ios/add-test-target-terminate
cleanup/base
github/fork/Dinisvgc/bugfix
github/fork/charlie2clarke/overground-icon
ab-max-open-file-limit
weblate-appstore-i18n
2024.03.27-3-android-hotfix
ab-3party-oauthcpp
android-hotfix-24031805
github/fork/gpesquero/test_distance
ab-android-revert-links
github/fork/RedAuburn/no-tts-info
ab-tts-simpler-strings
rt-android-huawei-crash
rt-android-release-2024.03.02
rt-android-release-2024.03.01
ab-ios-release-2024.02.27
ab-from-chars
gplay-android-auto-hotfix
ab-case-folding
rt-store-metadata
ab-buffer-vector-string-view
ab-update-gh-cache-action
rt-android-bookmark-export
osm-oauth2-support
vng-test
github/fork/gpesquero/tts_link
github/fork/Timmy-Tesseract/master
github/fork/ahmetlii/master
github/fork/sklueber/master
rt-geo-links
github/fork/AndrewShkrob/android/lanes-refactoring
vng-lines
windows3
android-auto-disable
rt-android-paranoid-mode
github/fork/TheAdventurer64/juice
rt-android-outdoor
ios-hotfix-release-dec-2023
rt-android-location-providers
pastk-outdoors-hiking-routes
pastk-2generate
pastk-classif-hiking-routes
vng-gen-kk
poc-disable-route-build-zoom
kk2
ab-thread-checker-qt-download-dialog-fix
revert-6461-category-letterbox-it
beta-outdoor
github/fork/pratyaksh1610/branch-6024
protobuf-24.4
designer-fixes
github/fork/AndrewShkrob/core/speed-limit-widget
vng-bookmarks
vng-outdoors
navigation/save-mode
pastk-TEST-rel-w-lines-stats
ab-kml-remove-unique-ptr
vng-bench
aa
rt-android-remove-workmanager
rt-android-debug
protobuf-24.3
pastk-core-housenumbers
github/fork/map-per/pedestrian
ruler-disable-reordering
android-warning-suppress
pastk-drape-bucket-discard-optimization
beta-ios-gpx-fix
github/fork/arnaudvergnet/android-structure-compose
github/fork/arnaudvergnet/compose
github/fork/Nimausfi/new-changes
github/fork/map-per/via_ferrata
pastk-generator-isolines-skip-resimplify
pastk-styles-world-railways
github/fork/kartikaysaxena/master
github/fork/Zhu-Pengming/TomABdh-patch-1
pastk-styles-TMP_dump_priorities
ab-increase-long-tap-radius
github/fork/map-per/track_number
github/fork/codeskraps/feature/nav_altitude_chart
car-checkpoint-tolerance
github/fork/barisunsalhn/fab-transparency
github/fork/N-45div/N-45div/issue4788
rt-android-fix-viewport
github/fork/n1snt/app-shortcuts
github/fork/Kovoschiz/yue4
vng-addr-test
downloader
github/fork/Aryan-Sagavekar/etaswitchfeature
obsolete-position-color
pastk-styles-geometryfallback
pastk-DEMO-geometry-1more-detailed
strings-be-ru-uk-miles
ios/external-keyboard-fix2
alex-outdoors
ios/blue-route-to
pastk-styles-fixpriorities2
pastk-styles-fixpriorities
rt-android-accent-color
pastk-drape-path_text_zoom_mask
pastk-drape-roadshields
update-appstore-metadata
pastk-styles-outdoors
3p/disable-system-jansson
ios/newly-created-list-order
czech-release
rt-fix-monkey-gh
github/fork/AndrewShkrob/core/rendering-on-many-surfaces
github/fork/SiarheiFedartsou/sf-clang-tidy2
ios/fix-tableview-headers-font
github/fork/dvrsaran/patch-1
rt-android-google-location-annoying
pastk-loc-share
ctest
windows2
kml-load-robust
tr-screenshots
vng-nav
github/fork/pastk/pastk-loc-share
github/fork/pratyaksh1610/branch-3621
d4f5409d-patch-1
rt-fix-location-resolution
github-actions-update
android_auto
matheusgomesms-store-releasenotes-pt_BRtranslation
rt-add-ci-timeout
rq-alterRoutes-vng
euskara
github/fork/trueTatar/latlon-refactoring
windows
tests-fix
pastk-styles-geometryfallback-1more-detailed
pastk-styles-zoomlessareas
github/fork/fgaz/changelog/2022.06.29-3
pastk-outdoors-beta
android/R8
github/fork/fardeenfs/public-transit
pastk-android-writability
rt-location-api
pastk-android-verifyerror
qt6
vng-my_pos
pastk-scripts
vng-sdfimage
vng-vehicle-refactoring
release-gp-fdroid-without-location-fixes
rt-android-track-recorder
rt-android-gplay-compliance
rt-android-remove-gms
rt-android-track-recorder-alarm
rt-android-keep-data
fix-odr
github/fork/pastk/pastk-storage
build/no-unity
backup-resources
android/warning-fixes
weblate-ios-i18n
rt-android-symlinks
weblate-android-i18n
weblate-whitespacing
rt-weblate-consume
ios/fixes
i18n-android
i18n-ios
rt-xcode-desktop
2025.03.02-7-android
2025.02.17-3-android
2025.01.26-9-android
2024.11.27-12-android
2024.11.12-7-android
2024.10.23-2-android
2024.10.08-5-android
2024.10.04-7-android
2024.09.08-7-android
2024.08.17-4-google-play
2024.08.16-5-android
2024.08.15-21-android
2024.08.15-17-android
2024.07.29-2-android
2024.07.27-7-ios
2024.07.27-8-android
2024.07.23-8-android
2024.07.08-3-android
2024.06.19-3-android
2024.06.02-12-android
2024.05.11-3-android-rc
2024.05.11-3-android
2024.05.10-1-ios
2024.05.04-9-android-rc
2024.05.04-9-android
2024.03.31-8-android-rc
2024.03.31-8-android
2024.03.31-3-android-rc
2024.03.27-3-android-hotfix
2024.03.27-5-android-hotfix
2024.03.18-5-android-hotfix
2024.03.05-4-android
2024.02.06-11-android
2024.02.06-8-android
2024.01.09-5-android
2023.12.20-4-android
2023.12.18-11-android
2023.12.18-10-android
2023.11.17-17-android
2023.09.22-27-android
2023.08.18-8-android
2023.07.13-10-android
2023.06.04-13-android
2023.05.08-7-android
2023.04.02-7-android
2023.03.05-5-android
2023.03.02-3-android
2023.02.13-11-android
2023.01.25-3-android
2022.12.18-12-android
2022.11.24-3-android
2022.11.02-2-android
2022.09.22-3-android
2022.09.15-5-android
2022.08.23-5-android
2022.07.27-3-android
2022.07.01-6-android
2022.06.29-3-android
2022.06.18-2-android
2022.05.31-10-android
2022.05.24-2-android
2022.05.20-5-android
2022.05.20-4-android
2022.05.19-4-android
2022.04.27-2-android
2022.03.23-4-android
2022.02.19-1-android
2022.02.16-29-android
2022.02.11-17-android
2022.01.15-3-android
2022.01.12-6-android
2022.01.12-3-android
2021.12.01-4-android
2021.11.04-2-android
2021.10.22-10-android
2021.10.15-15-android
2021.10.09-2-android
2021.10.08-0-ios
2021.09.14-4-android
2021.09.01-6-android
2021.08.26-13-ios
2021.08.26-14-android
2021.08.19-11-android
2021.08.19-6-android
2021.08.14-4-android
2021.08.09-1-ios
2021.08.07-4-ios
2021.08.05-2-android
2021.08.04-3-ios
2021.07.08-3
2021-07-03
2021.07.04-2
2021-06-23
2021-06-20
2021-06-12
2021-06-07
2021-05-21
2021-05-08
2021-05-05
2021-04-24
Labels
Clear labels
Accessibility
Address
Android
Android Auto
Android Automotive (AAOS)
API
AppGallery
AppStore
Battery and Performance
Blocker
Bookmarks and Tracks
Borders
Bug
Build
CarPlay
Classificator
Community
Core
CrashReports
Cycling
Desktop
DevEx
DevOps
dev_sandbox
Directions
Documentation
Downloader
Drape
Driving
Duplicate
Editor
Elevation
Enhancement
Epic
External Map Datasets
F-Droid
Fonts
Frequently User Reported
Fund
Generator
Good first issue
Google Play
GPS
GSoC
iCloud
Icons
iOS
Legal
Linux Desktop
Linux packaging
Linux Phone
Mac OS
Map Data
Metro
Navigation
Need Feedback
Night Mode
NLnet 2024-06-281
No Feature Parity
Opening Hours
Outdoors
POI Info
Privacy
Public Transport
Raw Idea
Refactoring
Regional
Regression
Releases
RoboTest
Route Planning
Routing
Ruler
Search
Security
Styles
Tests
Track Recording
Translations
TTS
UI
UX
Walk Navigation
Watches
Web
Wikipedia
Windows
Won't fix
World Map
No labels
Accessibility
Address
Android
Android Auto
Android Automotive (AAOS)
API
AppGallery
AppStore
Battery and Performance
Blocker
Bookmarks and Tracks
Borders
Bug
Build
CarPlay
Classificator
Community
Core
CrashReports
Cycling
Desktop
DevEx
DevOps
dev_sandbox
Directions
Documentation
Downloader
Drape
Driving
Duplicate
Editor
Elevation
Enhancement
Epic
External Map Datasets
F-Droid
Fonts
Frequently User Reported
Fund
Generator
Good first issue
Google Play
GPS
GSoC
iCloud
Icons
iOS
Legal
Linux Desktop
Linux packaging
Linux Phone
Mac OS
Map Data
Metro
Navigation
Need Feedback
Night Mode
NLnet 2024-06-281
No Feature Parity
Opening Hours
Outdoors
POI Info
Privacy
Public Transport
Raw Idea
Refactoring
Regional
Regression
Releases
RoboTest
Route Planning
Routing
Ruler
Search
Security
Styles
Tests
Track Recording
Translations
TTS
UI
UX
Walk Navigation
Watches
Web
Wikipedia
Windows
Won't fix
World Map
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps#6144
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
OAuth 1.0a is deprecated, and programs which use it to authenticate requests to OpenStreetMap should move to OAuth 2.0. A date has not yet been set for turning off OAuth 1.0a and HTTP Basic.
It's best to move to OAuth 2.0 well in advance of any turn-off, because users may take some time to upgrade software and to re-authenticate.
See https://github.com/openstreetmap/operations/issues/867 for details.
Upvote & Fund
mentioned in issue #867
I think you're using
OrganicMapsTestUser
for your Unit tests on master.apis.dev.openstreetmap.org. Are you using Basic Authentication or OAuth 1.0a there?I need to know if we have to take additional steps before merging the OAuth 1.0a removal in CGImap. Since we have an automated deployment in place, that would immediately break OAuth 1.0a for changeset uploads on the dev instance.
Our goal is to avoid any disruptive and unexpected changes on the dev instance.
Relevant commit is: https://github.com/zerebubuth/openstreetmap-cgimap/pull/354
NB: Production is not impacted by any of this at this point in time.
The same OAuth1.0a as in production is used in debugging/CI on the dev server. Do you have any recommendations or examples on how to properly migrate the manual auth code?
Thank you for your quick reply. I will discuss this point with our sysadmins, to make sure that we're not breaking anything here.
My recommendation here would be very clear to reach out to both
@tsmock
(JOSM) and@westnordost
(StreetComplete). They have either already completed the switch to OAuth 2.0, or are currently in the process of rolling out OAuth 2.0 as part of a beta version. I hope they're ok to mention them here, since I believe they could provide very valuable insights.Are you looking for solutions for both Java and C++? JOSM and StreetComplete should cover Java/Kotlin.
@tsmock
also had some discussions with Merkaartor, a C++ app. I'm not sure if this would be helpful in your case.You can of course also post to https://github.com/openstreetmap/operations/issues/867, which is the central issue to manage the transition. Besides all admins/core maintainers I would expect that you could reach out to a larger group of app developers this way.
Linking to a few relevant issues/PRs.
Hey
@biodranik
, I summarized it here:https://github.com/MarcusWolschon/osmeditor4android/issues/2401#issuecomment-1858819801
Feel free to ask me questions, I very recently concerned myself with it so my knowledge of it is fresh.
In a nutshell, using an OAuth2 access token is as simple as adding
Authorization: Bearer <the OAuth2 access token>
in the header of each HTTPS request. For getting the authorization token, the flow is similar but not exactly the same as for OAuth 1.0a.Thanks,
@westnordost
, that is helpful. The problem is that liboauthcpp used in OM does not support OAuth2: https://github.com/sirikata/liboauthcpp/issues/24Implementing the spec manually in C++ is not an easy task. If anyone is aware of simple and lightweight C++ implementations without networking code, please let us know.
You don't need a library for passing the access token. For getting the access token, ... maybe, but it is really not a lot. I implemented the logic in ~120 source lines of code, so that's the order of magnitude of code you would like to have outsourced into a lib. (The links to the source code are contained in my previously linked comment.)
For getting the access token, indeed to implement the whole spec would be quite a large undertaking, so an OAuth2 library that does that would not be lightweight.
Also, note that to get the access token at the end, the result from the server must be parsed as a JSON. So, a library that does all that (120 source lines of code worth of logic) for you will very likely pull in another dependency to a JSON parsing library, i.e. maybe a different one that you are using for other stuff. Not to mention the dependency to actually do HTTP requests. Oh, and, and optional feature that is nevertheless supported by OSM and recommended to be used is to include a PKCE key exchange in the process, which means a library that implements that (I think it is pretty standard these days) also needs a dependency to some sha256 hasher.
I am writing this because you mentioned that it should be lightweight. If you are looking for a library without networking code and without JSON parsing code, to be honest, there is not much code left. The exchange that happens to get the access token is basically nothing else than a bunch of HTTPS requests and reading the responses.
(I edited my post significantly to include more information)
mentioned in issue #7000
This issue is getting more important because of #7000
Probably it will be easier to implement auth in Java and Swift separately instead of doing this business in C++.
@rtsisyk
as it was mentioned by@westnordost
and@Zverik
, the decision to use login and password was a deliberate one, forced by issues with using Webview or browser login.To clarify: the existing OAuth1.0a solution was using webview from the start. And it can be adopted to using external web browser if necessary without migrating to OAuth2.
I didn't get the problem with WebView. OAuth2 is definitely better than asking the user to enter their password.
@rtsisyk
https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html
https://developers.googleblog.com/2021/06/upcoming-security-changes-to-googles-oauth-2.0-authorization-endpoint.html
As far as I know it is easy to circumvent this restriction by setting the user agent of the WebView to something other than the default. (You could test this by trying to login with OAuth with Google on OSM within STreetComplete.)
But anyway, using the browser is probably the better idea anyway. Though, expect issue tickets to appear that complain about that the login doesn't work on their browser or maybe even the default browser of certain Android distributions such as LineageOS (last time I checked).
Also, the information may be outdated, but back when I looked into the topic, the recommendation (or even obligation?) for apps on the Apple App store was the exact opposite, "to not break the native experience".
But take my comment with a grain of salt, because this was quite some years ago. Browser support may have been fixed, Apple may have either changed their policies or I misremember it in the first place.
Thanks for the hint!
Apple is ok with the app login. It's a Google Play issue only.
CC
@rtsisyk
OSM OWG mentioned the following in their API usage policy: https://operations.osmfoundation.org/policies/api/
Do not submit website forms in an automated manner or on behalf of users. Website forms are intended only for users interacting directly with the website.
I’m not exactly sure how you have implemented app login, and if this would impact you. I thought it might be good to double check this point, and reach out to OWG in case of further questions.
the registration button takes you to the OSM site, you can't create an account in-app.
The login is using OAuth, not the website forms 👍️
...And the login is not automated, users are doing it manually.
We are looking for Android engineers to implement new OSM authorization in the app. This work will be financially rewarded based on fair estimation of time and efforts spent. Please post your proposal in this thread.
This is not a proposal, just a few comments after a quick look at the source code in order to help make clear the scope of it:
The biggest part of the current OAuth 1.0a authentication is implemented in osm_oauth.cpp.
The normal OAuth authorization flow (OAuth 1.0a and OAuth 2.0 are quite similar) would be to
OM is currently using the following curious approach to OAuth authorization instead. As far as I understand:
I believe it is done that way to avoid the user leaving the app's UI for authorization but certainly is somewhat of a misuse of OAuth. Could just as well use HTTP Basic Auth, then. However, this is akin to how JOSM did it in the past, as far as I know.
But anyway, this is the reason why there is so much code.
Obviously, I strongly recommend just doing the normal OAuth 2.0 authorization flow, which is akin to the OAuth 1.0a but even a little simpler (actually). It is less code, it is more trustworthy and more future-proof (less chance that something breaks, when e.g. the HTML on osm.org changes). Google additionally requires (but it can be tricked) to use the browser instead of a WebView.
Of course, it is up for OM folks to decide how it should be implemented.
Note that OAuth 2.0 requires some basic JSON parsing, as the access token response is in JSON.
The Android part of the Login is in OsmLoginFragment.java and OsmOAuth.java, which is naturally almost empty because it does almost nothing else than provide the UI for entering the username+password and initiate the authorization in native code.
This also means that to implement OAuth 2.0 authorization only for Android but not for iOS makes no sense, as the main part is implemented in native code.
For further help on implementing OAuth 2.0, see https://github.com/MarcusWolschon/osmeditor4android/issues/2401#issuecomment-1858819801 , it also includes links to implementation.
assigned to
@strump
mentioned in issue #7426
mentioned in merge request !7478
I am removing this ticket from Release Blockers because it is not a blocker and it is actually going into the subsequent release (after the current one).
Done in #7333 thanks to
@strump
!