com.adobe.flashaccess.sdk.protocol.authentication
Class AuthenticationHandler

java.lang.Object
  extended by com.adobe.flashaccess.sdk.protocol.AbstractHandler
      extended by com.adobe.flashaccess.sdk.protocol.AbstractMessageHandler
          extended by com.adobe.flashaccess.sdk.protocol.MessageHandlerBase
              extended by com.adobe.flashaccess.sdk.protocol.authentication.AuthenticationHandler
All Implemented Interfaces:
HandlerInterface

public final class AuthenticationHandler
extends MessageHandlerBase

Authentication request/response handler. The handler reads an authentication request and parses the request message when parseRequest() is called. It generates an Authentication Token object when getRequest().generateAuthToken() is called, and sends an authentication response. If AuthenticationRequestMessage.generateAuthToken() is not called before close(), an authentication failure error code is sent.

                AuthenticationHandler handler = new AuthenticationHandler(config, inputStream, outputStream);
try {
handler.parseRequest();
AuthenticationRequestMessage request = handler.getRequest();
AuthenticationData authData = request.getUserCredentials();
if (authData instanceof UserPassAuthenticationData) {
// Determine if username/password are valid
// If so, request.generateAuthToken(), if not request.setErrorData()
}
} catch (HandlerParsingException e) {
// Use e.getErrorData() for info on the error which will be sent to the user
// Do not attempt to call any handler methods except close()
} finally {
// Always call close in a finally statement to ensure a response is sent to the client
handler.close();
}


Constructor Summary
AuthenticationHandler(HandlerConfiguration handlerConfig, java.io.InputStream in, java.io.OutputStream out)
          Instantiates a Flash Access handler for authentication requests and responses.
 
Method Summary
 AuthenticationRequestMessage getRequest()
          Retrieves the authentication request message sent by the client.
 
Methods inherited from class com.adobe.flashaccess.sdk.protocol.MessageHandlerBase
close
 
Methods inherited from class com.adobe.flashaccess.sdk.protocol.AbstractHandler
parseRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationHandler

public AuthenticationHandler(HandlerConfiguration handlerConfig,
                             java.io.InputStream in,
                             java.io.OutputStream out)
Instantiates a Flash Access handler for authentication requests and responses. The handler reads an authentication request and sends an authentication response when the close() method is called. handlerConfig must contain the server's credentials, which are used for decrypting requests, signing authentication tokens, and signing responses.

Parameters:
handlerConfig - Configuration information.
in - The request body.
out - The response.
Method Detail

getRequest

public AuthenticationRequestMessage getRequest()
Retrieves the authentication request message sent by the client.

Specified by:
getRequest in class MessageHandlerBase
Returns:
The authentication request message sent by the client.


[an error occurred while processing this directive] [an error occurred while processing this directive]