public interface CredentialsAgent
Authenticator.RequestorType.SERVER
which is equal to the OSM API credentials
in JOSMAuthenticator.RequestorType.PROXY
which is equal to the credentials for an
optional HTTP proxy server a user may useModifier and Type | Method and Description |
---|---|
CredentialsAgentResponse |
getCredentials(Authenticator.RequestorType requestorType,
String host,
boolean noSuccessWithLastResponse) |
Component |
getPreferencesDecorationPanel()
Provide a Panel that is shown below the API password / username fields
in the JOSM Preferences.
|
PasswordAuthentication |
lookup(Authenticator.RequestorType requestorType,
String host)
Looks up the credentials for a given type.
|
OAuthToken |
lookupOAuthAccessToken()
Lookup the current OAuth Access Token to access the OSM server.
|
void |
store(Authenticator.RequestorType requestorType,
String host,
PasswordAuthentication credentials)
Saves the credentials in
credentials for the given service type. |
void |
storeOAuthAccessToken(OAuthToken accessToken)
Stores the OAuth Access Token
accessToken . |
PasswordAuthentication lookup(Authenticator.RequestorType requestorType, String host) throws CredentialsAgentException
requestorType
- the type of service. Authenticator.RequestorType.SERVER
for the OSM API server, Authenticator.RequestorType.PROXY
for a proxy serverhost
- the hostname for these credentialsCredentialsAgentException
- thrown if a problem occurs in a implementation of this interfacevoid store(Authenticator.RequestorType requestorType, String host, PasswordAuthentication credentials) throws CredentialsAgentException
credentials
for the given service type.requestorType
- the type of service. Authenticator.RequestorType.SERVER
for the OSM API server, Authenticator.RequestorType.PROXY
for a proxy serverhost
- the hostname for these credentialscredentials
- the credentialsCredentialsManagerException
- thrown if a problem occurs in a implementation of this interfaceCredentialsAgentException
CredentialsAgentResponse getCredentials(Authenticator.RequestorType requestorType, String host, boolean noSuccessWithLastResponse) throws CredentialsAgentException
requestorType
- the type of service. Authenticator.RequestorType.SERVER
for the OSM API server, Authenticator.RequestorType.PROXY
for a proxy serverhost
- the hostname for these credentialsnoSuccessWithLastResponse
- true, if the last request with the supplied credentials failed; false otherwise.
If true, implementations of this interface are advised to prompt the user for new credentials.CredentialsAgentException
- thrown if a problem occurs in a implementation of this interfaceOAuthToken lookupOAuthAccessToken() throws CredentialsAgentException
CredentialsAgentException
- thrown if something goes wrongvoid storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsAgentException
accessToken
.accessToken
- the access Token. null, to remove the Access Token.CredentialsAgentException
- thrown if something goes wrongComponent getPreferencesDecorationPanel()