Package com.adobe.xfa.protocol
Class AuthenticationHandler
java.lang.Object
java.net.Authenticator
com.adobe.xfa.protocol.AuthenticationHandler
An abstract class from which to derive protocol authenticators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enumNested classes/interfaces inherited from class java.net.Authenticator
Authenticator.RequestorType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanCalled by Protocol to return the status of the authentication call.abstract booleanCalled by xfawsdlconnectionsetproxy to return the status of the authentication call, and if successfulabstract AuthenticationHandlerclone()Clone this AuthenticationHandler object.abstract booleangetBasicCredentials(String sURL, String sRealm, StringHolder sUserID, CharacterHolder aPassword) Called by Protocol to return the user id and password for the URLabstract booleangetBasicSOAPCredentials(String sSOAPAddress, String sConnectionName, String sOperationName, StringHolder sUserID, CharacterHolder aPassword) Called by xfawsdlconnectionsetproxy to return the user id and password for the SOAP headerabstract booleangetCertificateCredentials(String sUrl, CharacterHolder aCertPassword, IntegerHolder nCertSize, ObjectHolder<byte[]> oCertBuffer, StringHolder sHint) Called Protocol to return the certificate for the URLGets the name of our wsdl connection (wsdlConnection name="DataConnection")Gets the status of the current connectionGets the current handler type; client or servergetHint()Gets the hint used by some applications to track their certificategetHost()Gets the Host we are dealing with (server name)Gets the password, used for both transport and SOAPgetRealm()Gets the realm informationGets the the http:// SOAP address.Gets the SOAP layer authentication type.Gets thestring returned in the SOAP message Gets thereturned in the SOAP message Gets the name of the operation we are invoking in the SOAP messageGets the status of the current soap requestGets the transport layer authentication typegetType()Gets the type of transport authentication (basic, digest)getURL()Gets the URL we are dealing withGets the user id, used for both transport and SOAPabstract booleanThis method is called by the underlying protocol code to give the application a chance to deal with a server that states that Certificate Authority is unknown.voidlogMessage(MsgFormatPos oError) This method is called by the underlying Protocol code to give the application a chance to deal with a log message.voidreset()reset the member variablesvoidsetConnectionName(String sConnectionName) Sets the name of our wsdl connection (wsdlConnection name="DataConnection")voidSets the status of the current connection.voidsetHandlerType(AuthenticationHandler.HandlerType eHandlerType) Sets the current Handler type (client or server)voidSets the a hint used by some applications to track their certificate.voidSets the Host we are dealing with (server name).voidsetPassword(CharacterHolder aPassword) Sets the password, used for both transport and SOAP.voidSets the the realm information, to return to client.voidsetSOAPAddress(String sSOAPAddress) Sets the the http:// SOAP address.voidSets the SOAP layer authentication type.voidsetSOAPFaultCode(String sSOAPFaultCode) Sets thestring returned in the SOAP message voidsetSOAPFaultString(String sSOAPFault) Sets thereturned in the SOAP message voidsetSOAPOperation(String sSOAPOperation) Sets the name of the operation we are invoking in the SOAP messagevoidSets the the status of the current SOAP requestvoidSets the current transport authentication typevoidSets the type of transport authentication, to return to client.voidSets the current URL.voidSets the current user id.Methods inherited from class java.net.Authenticator
getDefault, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthenticationInstance, setDefault
-
Constructor Details
-
AuthenticationHandler
Constructor- Parameters:
eType- The handler type; CLIENT or SERVER
-
-
Method Details
-
checkAuthenticationStatus
public abstract boolean checkAuthenticationStatus()Called by Protocol to return the status of the authentication call. NOTE: You MUST return false in order to stop the authentication loop. If true is returned, Protocol assumes you want to loop again (ask the handler for credentials and try the http request again).- Returns:
- True to indicate that we should try to connect with the credentials, or False to cancel
-
checkSOAPAuthenticationStatus
public abstract boolean checkSOAPAuthenticationStatus()Called by xfawsdlconnectionsetproxy to return the status of the authentication call, and if successful- Returns:
- True to indicate that we should try to connect with the credentials, or False to cancel
-
clone
Clone this AuthenticationHandler object.- Returns:
- a copy of this object.
-
getBasicCredentials
public abstract boolean getBasicCredentials(String sURL, String sRealm, StringHolder sUserID, CharacterHolder aPassword) Called by Protocol to return the user id and password for the URL- Parameters:
sURL- passed in by the caller(Protocol) - the url we are connecting tosRealm- passed in by the caller(Protocol) - the realm information from the protocol layersUserID- to be filled by the method - the user id to use for the connectionaPassword- to be filled by the method - the password to use for the connection- Returns:
- True to indicate that we should try to connect with the credentials, or False to cancel
-
getBasicSOAPCredentials
public abstract boolean getBasicSOAPCredentials(String sSOAPAddress, String sConnectionName, String sOperationName, StringHolder sUserID, CharacterHolder aPassword) Called by xfawsdlconnectionsetproxy to return the user id and password for the SOAP header- Parameters:
sSOAPAddress- passed in by the caller - the SOAP address we are connecting tosConnectionName- passed in by the caller - the wsdlConnection namesOperationName- passed in by the caller - the name of the operation being calledsUserID- to be filled by the method - the user id to use for the connectionaPassword- to be filled by the method - the password to use for the connection- Returns:
- True to indicate that we should try to connect with the credentials, or False to cancel
-
getCertificateCredentials
public abstract boolean getCertificateCredentials(String sUrl, CharacterHolder aCertPassword, IntegerHolder nCertSize, ObjectHolder<byte[]> oCertBuffer, StringHolder sHint) Called Protocol to return the certificate for the URL- Parameters:
sUrl- passed in by the caller(Protocol), the url we are connecting toaCertPassword- the password to encode the certificate with. This parameter will only be populated if the pCertBuffer contains PKCS#12 data.nCertSize- the size of the certificate buffer. This is only populate if the pCertBuffer contains PKCS#12 data.oCertBuffer- depending on the application, this parameter may be populated with a buffer containing encrypted (using the aCertPassword specified parameter 2 above) PKCS#12 data, or PCCERT_CONTEXT (Windows specific) data, as some Windows applications may only have access to the Windows PCCERT_CONTEXT and not to a PKCS#12 stream. It this parameter is populated with a PCCERT_CONTEXT then the nCertSize parameter will be set to zero and the aCertPassword will be empty.sHint- this parameter is populated by the caller and used as a hint so that the calling application knows certificate they are working with when callback's are made.- Returns:
- True to indicate that we should try to connect with the credentials, or False to cancel
-
isCertificateAuthorityValid
This method is called by the underlying protocol code to give the application a chance to deal with a server that states that Certificate Authority is unknown. The application has the opportunity to say whether it is ok to proceed or not.- Parameters:
sUrl- passed in by the caller(Protocol), the url we are connecting to- Returns:
- True to indicate that we should relax the Certificate Authority checking and use this certificate, otherwise, False to fail the connection.
-
getConnectionName
Gets the name of our wsdl connection (wsdlConnection name="DataConnection")- Returns:
- the current wsdl connection name
-
getConnectStatus
Gets the status of the current connection- Returns:
- the current status as an eConnectStatus enumerated value
-
getHandlerType
Gets the current handler type; client or server- Returns:
- the current handler type as an eHandlerType enumerated value
-
getHint
Gets the hint used by some applications to track their certificate- Returns:
- the current hint
-
getHost
Gets the Host we are dealing with (server name)- Returns:
- the current host
-
getPassword
Gets the password, used for both transport and SOAP- Returns:
- the current password
-
getRealm
Gets the realm information- Returns:
- the current realm
-
getSOAPAddress
Gets the the http:// SOAP address.- Returns:
- the SOAP address
-
getSOAPAuthType
Gets the SOAP layer authentication type.- Returns:
- the SOAP authentication type as an eAuthenticationType enumerated value
-
getSOAPFaultCode
Gets thestring returned in the SOAP message - Returns:
- the SOAP fault code
-
getSOAPFaultString
Gets thereturned in the SOAP message - Returns:
- the SOAP fault string
-
getSOAPOperation
Gets the name of the operation we are invoking in the SOAP message- Returns:
- the SOAP operation
-
getSOAPRequestStatus
Gets the status of the current soap request- Returns:
- the SOAP request status as a eSOAPRequestStatus enumerated value
-
getURL
Gets the URL we are dealing with- Returns:
- the current URL
-
getTransportAuthType
Gets the transport layer authentication type- Returns:
- an eAuthenticationType enumerated value indicating the type
-
getType
Gets the type of transport authentication (basic, digest)- Returns:
- the current type
-
getUserID
Gets the user id, used for both transport and SOAP- Returns:
- the current user id
-
logMessage
This method is called by the underlying Protocol code to give the application a chance to deal with a log message.- Parameters:
oError- Error message to log
-
reset
public void reset()reset the member variables -
setConnectionName
Sets the name of our wsdl connection (wsdlConnection name="DataConnection")- Parameters:
sConnectionName- The wsdl connection name
-
setConnectStatus
Sets the status of the current connection.- Parameters:
eStatus- the status as an eConnectStatus enumeration value
-
setHandlerType
Sets the current Handler type (client or server)- Parameters:
eHandlerType- an eHandlerType enumeration value
-
setHint
Sets the a hint used by some applications to track their certificate. Client should set this.- Parameters:
sHint- the hint value
-
setHost
Sets the Host we are dealing with (server name). Protocol code should set this.- Parameters:
sHost- the host
-
setPassword
Sets the password, used for both transport and SOAP. Client should set this.- Parameters:
aPassword- the password
-
setRealm
Sets the the realm information, to return to client. Protocol/SOAP code should set this.- Parameters:
sRealm- the realm
-
setSOAPAddress
Sets the the http:// SOAP address.- Parameters:
sSOAPAddress- the SOAP address
-
setSOAPAuthType
Sets the SOAP layer authentication type.- Parameters:
eAuthType- the authentication type as an eAuthenticationType enumeration value
-
setSOAPFaultCode
Sets thestring returned in the SOAP message - Parameters:
sSOAPFaultCode- the fault code
-
setSOAPFaultString
Sets thereturned in the SOAP message - Parameters:
sSOAPFault- the fault string
-
setSOAPOperation
Sets the name of the operation we are invoking in the SOAP message- Parameters:
sSOAPOperation- the SOAP operation name
-
setSOAPRequestStatus
Sets the the status of the current SOAP request- Parameters:
eSOAPStatus- the status as an eSOAPRequestStatus enumeration value
-
setTransportAuthType
Sets the current transport authentication type- Parameters:
eAuthType- an eAuthenticationType enumerated value
-
setType
Sets the type of transport authentication, to return to client. Protocol/soap code should set this.- Parameters:
sType- the type
-
setURL
Sets the current URL. Protocol/soap code should set this.- Parameters:
sURL- the URL
-
setUserID
Sets the current user id. Client should set this.- Parameters:
sUserID- the user id
-