es.caib.ibkey.alfresco.ws
Class AuthenticationUtils

java.lang.Object
  extended by es.caib.ibkey.alfresco.ws.AuthenticationUtils
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

public class AuthenticationUtils
extends java.lang.Object
implements javax.security.auth.callback.CallbackHandler

Author:
Roy Wetherall Modified by Pere Joseph

Constructor Summary
AuthenticationUtils()
           
 
Method Summary
static void endSession(WebServiceFactory.WebServiceFactoryConfig config)
          Ends the current session
static AuthenticationDetails getAuthenticationDetails()
          Get the authentication details for the current thread
static org.apache.axis.EngineConfiguration getEngineConfiguration()
          Gets the engine configuration used to create the web service references
static java.lang.String getTicket()
          Get the ticket for the current authentication details on the current thread
 void handle(javax.security.auth.callback.Callback[] callbacks)
          The implementation of the passwrod call back used by the WS Security
static boolean isCurrentTicketTimedOut(WebServiceFactory.WebServiceFactoryConfig config)
           
static void setAuthenticationDetails(AuthenticationDetails authenticationDetails)
           
static void startSession(WebServiceFactory.WebServiceFactoryConfig config, java.lang.String username, java.lang.String password)
          Start a session
static void startSession(WebServiceFactory.WebServiceFactoryConfig config, java.lang.String username, java.lang.String password, long timeoutInterval)
          Start a session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationUtils

public AuthenticationUtils()
Method Detail

startSession

public static void startSession(WebServiceFactory.WebServiceFactoryConfig config,
                                java.lang.String username,
                                java.lang.String password)
                         throws AuthenticationFault,
                                InternalErrorException
Start a session

Parameters:
config -
username -
password -
Throws:
AuthenticationFault
InternalErrorException

startSession

public static void startSession(WebServiceFactory.WebServiceFactoryConfig config,
                                java.lang.String username,
                                java.lang.String password,
                                long timeoutInterval)
                         throws AuthenticationFault,
                                InternalErrorException
Start a session

Parameters:
config -
username -
password -
timeoutInterval - timeout interval
Throws:
AuthenticationFault
InternalErrorException

setAuthenticationDetails

public static void setAuthenticationDetails(AuthenticationDetails authenticationDetails)

isCurrentTicketTimedOut

public static boolean isCurrentTicketTimedOut(WebServiceFactory.WebServiceFactoryConfig config)
                                       throws InternalErrorException
Returns:
if timeoutInterval is not set return false.
Throws:
InternalErrorException

endSession

public static void endSession(WebServiceFactory.WebServiceFactoryConfig config)
                       throws InternalErrorException
Ends the current session

Parameters:
config -
Throws:
InternalErrorException

getTicket

public static java.lang.String getTicket()
Get the ticket for the current authentication details on the current thread

Returns:
String the ticket

getAuthenticationDetails

public static AuthenticationDetails getAuthenticationDetails()
Get the authentication details for the current thread

Returns:
the authentication details

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws java.io.IOException,
                   javax.security.auth.callback.UnsupportedCallbackException
The implementation of the passwrod call back used by the WS Security

Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Throws:
java.io.IOException
javax.security.auth.callback.UnsupportedCallbackException
See Also:
CallbackHandler.handle(javax.security.auth.callback.Callback[])

getEngineConfiguration

public static org.apache.axis.EngineConfiguration getEngineConfiguration()
Gets the engine configuration used to create the web service references

Returns:
EngineConfiguration the engine configuration


Copyright © 2012 Direcció General de Tecnologia i Comunicacions. Govern de les Illes Balears. All Rights Reserved.