| Version 58 (modified by , 2 hours ago) ( diff ) |
|---|
Languages:
Preferences > OSM Server
Table of content
Connection Settings for the OSM server
Downloading and uploading to the default server
Most JOSM users want to exchange geo data with the standard OSM server operated by the OSM community.
Tick the respective checkbox in order to download from and upload to the standard server (see screenshot above). This is the default setting.
Advanced option: Downloading and uploading to a custom server
Some JOSM users need to configure the API URL of an OSM server because they are working with a custom server:
- Some users are working with local installations of the OSM server
- Some users are working with development and test instances of the OSM server (for instance with https://api06.dev.openstreetmap.org).
- Some users are mapping on other projects running the OSM server software, such as OpenHistoricalMap or OpenGeofiction.
In order to use a custom URL:
- Remove the tick in the checkbox for the standard API URL (see screenshot above)
- Enter the API URL
Click on Validate to test whether an OSM API server is available at the given URL. If so, JOSM will display the icon to the right of the input field for the API URL. If the URL isn't valid, JOSM will display the icon
.
The authentication settings below belong to the server: JOSM keeps them, and the Access Token, separately for each server, so you can switch between servers without authorizing again.
Authentication
Working anonymously or with an OSM account
You don't need to identify and authenticate yourself provided that you neither upload data to the OSM server nor download data for which you must authenticate first.
If you work anonymously you are allowed
- to download geo-data from the OSM server and save it to a local file
- to download public GPS traces from the OSM server
- to load geo data from a file, edit it, and save it back to a file
However, you can't
- upload geo-data to the OSM server. You can't created, update, or close changesets either.
- download your private GPS traces
You are recommended to create an OSM user account. By using this form you can choose an OSM username and an OSM password. You will enter them on the OSM website when you authorize JOSM, never in JOSM itself.
OAuth 2.0 based authentication
OAuth 2.0 is the way JOSM authenticates at the OSM server. Instead of giving JOSM your password, you log in on the website of the server, in your web browser, and authorize JOSM there. The server then issues an Access Token to JOSM, which JOSM sends with each request. Your password is never entered into JOSM nor stored by it, and you can revoke the token on the website at any time.
OAuth 2.0 uses Remote Control to receive the token from the OAuth server. If Remote Control is disabled in preferences (default setting) it is temporarily enabled to receive the token and then disabled again. Note: If you have issues authenticating, you can disable remote control in other running instances of JOSM and disable then re-enable it in the JOSM instance you are trying to authenticate.
Authorizing JOSM
- Click on Authorize now. JOSM opens the authorization page of the OSM server in your web browser.
- Log in, if the website asks you to, and allow JOSM to access your account.
- Go back to JOSM and click OK in the preferences to save the Access Token.
You don't have to do this in advance: when you upload without an Access Token, JOSM asks Obtain OAuth 2.0 token for authentication? and goes through the same steps.
Authorize now is disabled when JOSM has no OAuth Client ID for the server; see Advanced OAuth parameters below.
Once JOSM has an Access Token
- Deselect the checkbox Save to preferences if you don't want to save the Access Token in the JOSM preferences. If you don't save it the Access Token will be lost when you close JOSM. If you later startup JOSM again you will have to retrieve a new Access Token to work with OAuth based authentication again.
- Select Use OAuth for all requests to … to send the Access Token with downloads too, so that the server applies the limits of your account instead of those of your IP address.
- Click on New Access Token to authorize JOSM again and replace the token, for instance after you revoked it on the website. If this fails, JOSM keeps the token it has.
- Click on Test Access Token to submit a test request with the token to the OSM server. JOSM retrieves your user details with it: on success, it shows the user name and id the token belongs to; otherwise it says whether the server rejected the token, or whether the server could not be reached.
- Click on Remove token to remove the current token from JOSM. This does not revoke it on the server; do that on the website. The
Authorize nowbutton will reappear. The advanced OAuth parameters you entered for the server are kept.
Advanced OAuth parameters
With Use default settings ticked, JOSM uses the OAuth settings it has built in for the server, or which the server publishes:
- The OAuth Client ID of the JOSM application registered on the server. JOSM has one built in for openstreetmap.org, the OSM development servers, OpenHistoricalMap and OpenGeofiction.
- The endpoints: those the server publishes in its OAuth metadata (RFC 8414); otherwise those of the OSM website software, which are the API URL without
/api, followed by/oauth2/authorizeand/oauth2/token.
For any other server JOSM has no Client ID, so Authorize now stays disabled, and an upload ends with the message JOSM cannot obtain an OAuth Access Token for this server, because it has no OAuth Client ID for it. Untick Use default settings and enter the settings of an OAuth 2.0 application registered on the server, either by you or by the server operator. On a server running the OSM website software, you can register one yourself under My Settings > OAuth 2 applications. Operators of a server can find what JOSM needs in Using JOSM with your own OSM server.
| Field | What to enter |
|---|---|
| Client ID | The Client ID of the OAuth 2.0 application registered on the server. |
| Client Secret | Only needed if the application is registered as confidential. The applications JOSM has built in are public clients and have none. |
| Redirect URL | Must be exactly the redirect URL registered with the application. JOSM receives the authorization at http://127.0.0.1:8111/oauth_authorization, by remote control.
|
| Access Token URL | Where JOSM gets the Access Token from: on the OSM website software, the address of the website followed by /oauth2/token, not the API URL.
|
| Authorize URL | Where the web browser is sent to authorize JOSM: on the OSM website software, the address of the website followed by /oauth2/authorize, not the API URL.
|
The application has to be allowed the permissions JOSM asks for: read_gpx, write_gpx, read_prefs, write_prefs, write_api and write_notes.
Ticking Use default settings again replaces what you entered; JOSM asks before it does.
Using an Access Token obtained outside JOSM
The Access Token field, below the advanced OAuth parameters, shows the token JOSM has for the server. Instead of clicking Authorize now, you can paste a token there that you obtained in another way, and click OK. It needs the permissions listed above. Nothing else needs to be entered for a pasted token to work.
Basic authentication
(Expert mode only)
With Basic authentication, JOSM sends your user name and password with every request. openstreetmap.org and OpenGeofiction no longer accept it, so JOSM does not offer it for them. It remains for testing your own server, for instance a local installation of the OSM website software. The choice between OAuth 2.0 and Basic authentication is only shown in expert mode, or while Basic authentication is selected.
Here's a screenshot of the preferences panel for basic authentication:
To use Basic Authentication
- Go to the register OSM Server in Preferences
- Select the authentication method Basic authentication
- Enter your OSM username and your OSM password
JOSM stores your password in clear text in its preferences file, unless a plugin such as native-password-manager keeps it elsewhere.
New OSM account messages and max age of closed OSM Notes
New OSM account messages
JOSM, by default, periodically checks for unread OSM account messages. Unchecking Periodically check for new messages will disable the check (advanced preference: message.notifier.enabled). Below the checkbox the interval in minutes can be set (advanced preference: message.notifier.interval). The default value is 5 minutes.
Max age of closed OSM Notes
The maximum age in days of closed OSM Notes can be set (advanced preference: osm.notes.daysClosed). The default value is 7 days. See Advanced preferences for notes for details.
Overpass server
(Expert mode only)
Configure the Overpass API instance used for downloading OSM data (for instance in Download from Overpass API) (advanced preference: download.overpass.server). See for a list of servers.
With a checked Use Overpass server for object downloads the overpass server is used for all actions which request to download specified objects like Download Object, Download parent ways/relations … or downloading (incomplete) members of relations (advanced preference: download.overpass.for-multi-fetch).
Back to Preferences
Back to Edit Menu
Back to Main Menu
Back to Main Help
Attachments (13)
- basic-authentication.png (7.5 KB ) - added by 17 years ago.
- use-default-api-url.png (3.1 KB ) - added by 17 years ago.
- use-custom-api-url.png (3.5 KB ) - added by 17 years ago.
-
proxy-settings.png
(68.9 KB
) - added by 14 years ago.
new proxy-settings
-
oauth-authentication.png
(69.2 KB
) - added by 14 years ago.
oauth screenshot
-
PreferencesOsmServer.png
(138.1 KB
) - added by 6 years ago.
new screenshot
-
PreferencesOsmServerExpert.png
(149.0 KB
) - added by 6 years ago.
new expert mode screenshot
- basic-authentication.2.png (14.6 KB ) - added by 3 years ago.
-
oauth-2-authentication.png
(217.3 KB
) - added by 3 years ago.
OAuth 2.0 authentication (logged in)
- oauth-2-authentication.2.png (288.4 KB ) - added by 2 hours ago.
- basic-authentication.3.png (32.7 KB ) - added by 2 hours ago.
- oauth-2-advanced.png (310.1 KB ) - added by 2 hours ago.
- oauth-2-not-authorized.png (27.2 KB ) - added by 2 hours ago.
Download all attachments as: .zip


