Class OAuth20Parameters
java.lang.Object
org.openstreetmap.josm.data.oauth.OAuth20Parameters
- All Implemented Interfaces:
IOAuthParameters
Parameters for OAuth 2.0
- Since:
- 18650
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final Stringprivate static final Stringprivate final Stringprivate static final Stringprivate static final Stringprivate final Stringprivate final Stringprivate static final Stringprivate final Stringprivate static final Stringprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionOAuth20Parameters(String jsonString) Recreate a parameter object from a JSON stringOAuth20Parameters(String clientId, String clientSecret, String baseUrl, String apiUrl, String redirectUri) Create a new OAuth parameter objectOAuth20Parameters(String clientId, String clientSecret, String tokenUrl, String authorizeUrl, String apiUrl, String redirectUri) Create a new OAuth parameter object -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the access token URLGet the actual API URLGet the base authorization URL to open in a browserGet the client idGet the client secretGet the OAuth version that the API expectsGet the redirect URIinthashCode()voidStore the preferences for these parametersConvert to a preference stringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.oauth.IOAuthParameters
getAuthorizationUrl, getAuthorizationUrl
-
Field Details
-
REDIRECT_URI
- See Also:
-
CLIENT_ID
- See Also:
-
CLIENT_SECRET
- See Also:
-
TOKEN_URL
- See Also:
-
AUTHORIZE_URL
- See Also:
-
API_URL
- See Also:
-
redirectUri
-
clientSecret
-
clientId
-
tokenUrl
-
authorizeUrl
-
apiUrl
-
-
Constructor Details
-
OAuth20Parameters
Recreate a parameter object from a JSON string- Parameters:
jsonString- The JSON string with the required data
-
OAuth20Parameters
public OAuth20Parameters(String clientId, String clientSecret, String baseUrl, String apiUrl, String redirectUri) Create a new OAuth parameter object- Parameters:
clientId- The client id. May not benull.clientSecret- The client secret. May benull. Not currently used.baseUrl- The base url. This assumes that the endpoints are/tokenand/authorize.apiUrl- The API urlredirectUri- The redirect URI for the client.
-
OAuth20Parameters
public OAuth20Parameters(String clientId, String clientSecret, String tokenUrl, String authorizeUrl, String apiUrl, String redirectUri) Create a new OAuth parameter object- Parameters:
clientId- The client id.clientSecret- The client secret. May benull. Not currently used.tokenUrl- The token request URL (RFC6749 4.4.2)authorizeUrl- The authorization request URL (RFC6749 4.1.1)apiUrl- The API urlredirectUri- The redirect URI for the client.
-
-
Method Details
-
getAccessTokenUrl
Description copied from interface:IOAuthParametersGet the access token URL- Specified by:
getAccessTokenUrlin interfaceIOAuthParameters- Returns:
- The URL to use to switch the code to a token
-
getAuthorizationUrl
Description copied from interface:IOAuthParametersGet the base authorization URL to open in a browser- Specified by:
getAuthorizationUrlin interfaceIOAuthParameters- Returns:
- The base URL to send to the browser
-
getOAuthVersion
Description copied from interface:IOAuthParametersGet the OAuth version that the API expects- Specified by:
getOAuthVersionin interfaceIOAuthParameters- Returns:
- The oauth version
-
getClientId
Description copied from interface:IOAuthParametersGet the client id- Specified by:
getClientIdin interfaceIOAuthParameters- Returns:
- The client id
-
getClientSecret
Description copied from interface:IOAuthParametersGet the client secret- Specified by:
getClientSecretin interfaceIOAuthParameters- Returns:
- The client secret
-
getRedirectUri
Description copied from interface:IOAuthParametersGet the redirect URI- Specified by:
getRedirectUriin interfaceIOAuthParameters- Returns:
- The redirect URI
-
getApiUrl
Description copied from interface:IOAuthParametersGet the actual API URL- Specified by:
getApiUrlin interfaceIOAuthParameters- Returns:
- The API URl
-
rememberPreferences
Store the preferences for these parametersThe parameters are stored under the host of the API, where the access token of the server stores its parameters as well.
- Specified by:
rememberPreferencesin interfaceIOAuthParameters
-
toPreferencesString
Description copied from interface:IOAuthParametersConvert to a preference string- Specified by:
toPreferencesStringin interfaceIOAuthParameters- Returns:
- the preference string
-
hashCode
-
equals
-