Ignore:
Timestamp:
2024-02-21T21:26:18+01:00 (3 months ago)
Author:
taylor.smock
Message:

Fix #22810: OSM OAuth 1.0a/Basic auth deprecation and removal

As of 2024-02-15, something changed in the OSM server configuration. This broke
our OAuth 1.0a implementation (see #23475). As such, we are removing OAuth 1.0a
from JOSM now instead of when the OSM server removes support in June 2024.

For third-party OpenStreetMap servers, the Basic Authentication method has been
kept. However, they should be made aware that it may be removed if a non-trivial
bug occurs with it. We highly recommend that the third-party servers update to
the current OpenStreetMap website implementation (if only for their own security).

Failing that, the third-party server can implement RFC8414. As of this commit,
we currently use the authorization_endpoint and token_endpoint fields.
To check and see if their third-party server implements RFC8414, they can go
to <server host>/.well-known/oauth-authorization-server.

Prominent third-party OpenStreetMap servers may give us a client id for their
specific server. That client id may be added to the hard-coded client id list
at maintainer discretion. At a minimum, the server must be publicly
available and have a significant user base.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgent.java

    r18877 r18991  
    77
    88import org.openstreetmap.josm.data.oauth.IOAuthToken;
    9 import org.openstreetmap.josm.data.oauth.OAuthToken;
    109
    1110import jakarta.annotation.Nullable;
     
    6564     * @return the current OAuth Access Token to access the OSM server.
    6665     * @throws CredentialsAgentException if something goes wrong
     66     * @deprecated since 18991 -- OAuth 1.0 is being removed from the OSM API
    6767     */
    68     OAuthToken lookupOAuthAccessToken() throws CredentialsAgentException;
     68    @Deprecated
     69    default IOAuthToken lookupOAuthAccessToken() throws CredentialsAgentException {
     70        throw new CredentialsAgentException("Call to deprecated method");
     71    }
    6972
    7073    /**
     
    8588     * @param accessToken the access Token. null, to remove the Access Token.
    8689     * @throws CredentialsAgentException if something goes wrong
     90     * @deprecated since 18991 -- OAuth 1.0 is being removed from the OSM API
    8791     */
    88     void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsAgentException;
     92    @Deprecated
     93    default void storeOAuthAccessToken(IOAuthToken accessToken) throws CredentialsAgentException {
     94        throw new CredentialsAgentException("Call to deprecated method");
     95    }
    8996
    9097    /**
     
    93100     * @param host The host the access token is for
    94101     * @param accessToken the access Token. null, to remove the Access Token. This will remove all IOAuthTokens <i>not</i> managed by
    95      *                    {@link #storeOAuthAccessToken(OAuthToken)}.
     102     *                    {@link #storeOAuthAccessToken(IOAuthToken)}.
    96103     * @throws CredentialsAgentException if something goes wrong
    97104     * @since 18650
Note: See TracChangeset for help on using the changeset viewer.