|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.core.io.UserCredentials
public class UserCredentials
This class represents user credential for accessing secure ArcGIS Services and Tasks. A user's credential is either composed of a user account (username,password) or a secure token.
Nested Class Summary | |
---|---|
static class |
UserCredentials.AuthenticationType
The supported authentication type. |
Constructor Summary | |
---|---|
UserCredentials()
Constructs an instance of UserCredentials. |
|
UserCredentials(UserCredentials other)
Instantiates a copy of the given credential. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
UserCredentials.AuthenticationType |
getAuthenticationType()
Gets the type of the UserCredentials. |
UserCredentials |
getCopy()
Returns a copy of the instance. |
String |
getPassword()
Returns the password that this instance was initialized with. |
String |
getReferer()
Returns the referer that was supplied with the token string. |
String |
getToken()
Returns the token that this instance was initialized with. |
long |
getTokenExpiry()
|
String |
getTokenServiceUrl()
Returns the remote token service url that this instance was initialized with. |
static KeyStore |
getTrustStore()
Deprecated. |
String |
getUserName()
Returns the user name that this instance was initialized with. |
int |
hashCode()
|
boolean |
isEmpty()
Returns true if the credentials is empty or lack of enough information. |
boolean |
isSSLRequired()
Returns whether or not the service should only be connected to with SSL encryption (usually https). |
void |
setAuthenticationType(UserCredentials.AuthenticationType type)
Sets the type of the UserCredentials. |
void |
setSSLRequired(boolean required)
Sets whether or not the service should only be connected to with SSL encryption (usually https). |
void |
setTokenServiceUrl(String tokenServiceUrl)
Sets the URL to a remote token service if it is different from the default ArcGIS token service. |
static void |
setTrustStore(KeyStore keyStore)
Sets a KeyStore that contains trusted self-signed certificates for accessing HTTPS GIS service endpoints in an application. |
static void |
setTrustStore(KeyStore clientCA,
String password,
KeyStore trustCA)
Sets KeyStores which contain server and client certificates for accessing HTTPS GIS service endpoints in an application. |
void |
setUserAccount(String userName,
String password)
Sets the user account for accessing a secure Service or Task in an application. |
void |
setUserToken(String token,
long tokenExpiry,
String referer)
Sets the user token for accessing a secure Service or Task in an application. |
void |
setUserToken(String token,
String referer)
Sets the user token for accessing a secure Service or Task in an application. |
UserCredentials.AuthenticationType |
verifyAuthenticationType()
Looks up the authentication type based on the information available. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserCredentials()
public UserCredentials(UserCredentials other)
other
- the instance to copy.Method Detail |
---|
public UserCredentials getCopy()
public static void setTrustStore(KeyStore keyStore) throws EsriSecurityException
keyStore
- the KeyStore of CAs to trust.
EsriSecurityException
- the esri security exception
KeyStore.public static void setTrustStore(KeyStore clientCA, String password, KeyStore trustCA) throws EsriSecurityException
trustCA
- the KeyStore of server CAs to trust.clientCA
- the KeyStore of the client certificates.password
- the password to access the client certificates.
EsriSecurityException
- the ESRI security exception
KeyStore.@Deprecated public static KeyStore getTrustStore()
public void setUserAccount(String userName, String password)
userName
- the usernamepassword
- the passwordpublic void setUserToken(String token, String referer)
token
is a secure
token generated by an ArcGIS Token service or a Remote token service. Tokens are generated either by sending an
HTTP URL request to a Token service end-point or through an HTML page. Regardless of which option is chosen, it is
always necessary for a clientid paramter to be specified as a parameter for generating a secure token. The clientid
is typically the identity of the client application consuming the secure service. For Android/Java applications,
the clientid would be the referer
string that is either the name of the application consuming the
secure service or any other client identification string that is appropriate for the application. It is required
that the referer string that was used to generate the token be supplied to this method. For documentation on how to
generate tokens please refer to the following resource:
token
- the secure token stringreferer
- the referer stringpublic void setUserToken(String token, long tokenExpiry, String referer)
token
is a secure
token generated by an ArcGIS Token service or a Remote token service. Tokens are generated either by sending an
HTTP URL request to a Token service end-point or through an HTML page. Regardless of which option is chosen, it is
always necessary for a clientid paramter to be specified as a parameter for generating a secure token. The clientid
is typically the identity of the client application consuming the secure service. For Android/Java applications,
the clientid would be the referer
string that is either the name of the application consuming the
secure service or any other client identification string that is appropriate for the application. It is required
that the referer string that was used to generate the token be supplied to this method. For documentation on how to
generate tokens please refer to the following resource:
token
- the secure token stringtokenExpiry
- expiry date of tokenreferer
- the referer stringpublic void setTokenServiceUrl(String tokenServiceUrl)
tokenServiceUrl
- a URL
to a remote token servicepublic String getToken()
public long getTokenExpiry()
public String getReferer()
public String getTokenServiceUrl()
public String getUserName()
public String getPassword()
public boolean isSSLRequired()
public void setSSLRequired(boolean required)
required
- set to ture to use SSL.public UserCredentials.AuthenticationType getAuthenticationType()
verifyAuthenticationType()
public void setAuthenticationType(UserCredentials.AuthenticationType type)
type
- The type to set.public UserCredentials.AuthenticationType verifyAuthenticationType()
public boolean isEmpty()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |