Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Auth for third-party editors (iD MR-Fork, Rapid, JOSM) after API key removal – proposal for a token exchange

Open
#1,289 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
12/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
scala

Research direction

This is a design proposal with no code location named, so start by reading the linked forum incident report and the two proposed options (access-token exchange versus OIDC ID token). The proposed endpoints are POST /auth/exchange and calls to the OSM API at /api/0.6/user/details and /api/0.6/permissions. Done means maintainers agree on one approach and the scope of the session token, which is a decision for the project, not a patch.

Written by the indexing model from the issue text.

Description

Thanks for the detailed incident report.

I'm working on a MapRoulette integration for iD at https://github.com/tordans/iD/pull/4 (browse tasks, edit, mark them fixed / not an issue / etc. from within the editor). Like standalone Rapid and the JOSM plugin, it used the API key from the OSM preference maproulette_apikey_v2, so task status updates now fail. The forum post says editor integrations will come back with "details still to be determined", so here is what the situation looks like from a browser-based editor and a proposal on how I think this could work.

Ideally I want a way from inside my iD-MR-Integration that Users can confirm for MR that they have a valid OSM Auth going. Or a way to create a handshake with MR directly.

Proposal: exchange an OSM token for a MapRoulette session token

Editors already hold an OSM OAuth2 token for the logged-in user. MapRoulette could accept it once and issue its own token:

  1. POST /auth/exchange with Authorization: Bearer <OSM access token>.
  2. MapRoulette verifies the token against GET /api/0.6/user/details and checks GET /api/0.6/permissions, requiring write_api.
  3. MapRoulette returns its own session token: random, short-lived, revocable, stored only as a hash. The OSM token is not stored.
  4. API requests accept Authorization: Bearer <MapRoulette session token> as an alternative to the cookie.

Suggested limits:

  • The session token only works for task actions (set status, comment, start/release), not for challenge or project administration, and never returns private user fields.
  • We could go so far that users can see and revoke active editor sessions on their profile. Not sure if that is needed though…
  • Optionally an allowlist of origins for the exchange endpoint.

Why I think this is safe enough: an application that holds an OSM token with write_api can already edit OpenStreetMap as that user, so being able to mark MapRoulette tasks as done adds little. Requiring write_api keeps out applications that only have e.g. read_prefs, which was the path in the second vulnerability of the report.

Stricter variant

If you want to control which applications may connect: accept an OSM OpenID Connect ID token instead of the access token. It is signed by OSM, carries the application's client ID in aud (so an allowlist of client IDs is possible), and grants no OSM permissions. The downside is that editors need to request the openid scope, which means a re-authorization for their users and a config change those Oauth Apps.


What are your thought on how to build this feature out?

Dominant language
Scala
Stars
53
Forks
39
Avg merge
9h 24m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from maproulette/maproulette-backend

All issues in maproulette/maproulette-backend

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.