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(java.net.Authenticator.RequestorType requestorType,
java.lang.String host,
boolean noSuccessWithLastResponse) |
java.awt.Component |
getPreferencesDecorationPanel()
Provide a Panel that is shown below the API password / username fields
in the JOSM Preferences.
|
java.net.PasswordAuthentication |
lookup(java.net.Authenticator.RequestorType requestorType,
java.lang.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(java.net.Authenticator.RequestorType requestorType,
java.lang.String host,
java.net.PasswordAuthentication credentials)
Saves the credentials in
credentials for the given service type. |
void |
storeOAuthAccessToken(OAuthToken accessToken)
Stores the OAuth Access Token
accessToken . |
java.net.PasswordAuthentication lookup(java.net.Authenticator.RequestorType requestorType, java.lang.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(java.net.Authenticator.RequestorType requestorType, java.lang.String host, java.net.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 credentialsCredentialsAgentException
- thrown if a problem occurs in a implementation of this interfaceCredentialsAgentResponse getCredentials(java.net.Authenticator.RequestorType requestorType, java.lang.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 wrongjava.awt.Component getPreferencesDecorationPanel()