Class OAuthParameters


  • public final class OAuthParameters
    extends java.lang.Object
    This class manages an immutable set of OAuth parameters.
    Since:
    2747 (static factory class since 18991)
    • Method Detail

      • createDefault

        public static IOAuthParameters createDefault()
        Replies a set of default parameters for a consumer accessing the standard OSM server at IUrls.getDefaultOsmApiUrl().

        Note that this may make network requests for RFC 8414 compliant endpoints.

        Returns:
        a set of default parameters
      • createDefault

        public static IOAuthParameters createDefault​(java.lang.String apiUrl,
                                                     OAuthVersion oAuthVersion)
        Replies a set of default parameters for a consumer accessing an OSM server at the given API url. URL parameters are only set if the URL equals IUrls.getDefaultOsmApiUrl() or references the domain "dev.openstreetmap.org", otherwise they may be null.

        Note that this may make network requests for RFC 8414 compliant endpoints.

        Parameters:
        apiUrl - The API URL for which the OAuth default parameters are created. If null or empty, the default OSM API url is used.
        oAuthVersion - The OAuth version to create default parameters for
        Returns:
        a set of default parameters for the given apiUrl
        Since:
        18650
      • getRFC8414Parameters

        private static jakarta.json.JsonObject getRFC8414Parameters​(java.lang.String apiUrl)
      • getDefaultOAuth20Parameters

        private static OAuth20Parameters getDefaultOAuth20Parameters​(java.lang.String apiUrl)
        Get the default OAuth 2.0 parameters
        Parameters:
        apiUrl - The API url
        Returns:
        The default parameters
      • createFromApiUrl

        public static IOAuthParameters createFromApiUrl​(java.lang.String apiUrl,
                                                        OAuthVersion oAuthVersion)
        Replies a set of parameters as defined in the preferences.
        Parameters:
        oAuthVersion - The OAuth version to use.
        apiUrl - the API URL. Must not be null.
        Returns:
        the parameters
        Since:
        18650