no.feide.moria.webservices.v2_1
Class AuthenticationImpl

java.lang.Object
  extended by no.feide.moria.webservices.v2_1.AuthenticationImpl
All Implemented Interfaces:
java.rmi.Remote, Authentication

public final class AuthenticationImpl
extends java.lang.Object
implements Authentication

Version:
$Revision: 1.6 $
Author:
Bjørn Ola Smievoll <b.o.smievoll@conduct.no>

Field Summary
private static java.lang.String AUTHN_EX_MSG
          Log message for AuthenticationExceptions.
private static java.lang.String AUTHZ_EX_MESSAGE
          Log message for AuthorizationExceptions.
private static java.lang.String DIR_UNAV_EX_MSG
          Log message for DirectoryUnavailableExceptions.
private static java.lang.String INOP_STATE_EX_MSG
          Log message for InoperableStateExceptions.
private  no.feide.moria.log.MessageLogger messageLogger
          Class wide logger.
private static java.lang.String MORIACTRL_EX_MESSAGE
          Log message for MoriaControllerExceptions.
private static java.lang.String UNKNOWN_TICKET_EX_MSG
          Log message for UnknownTicketExceptions.
 
Constructor Summary
AuthenticationImpl()
          Default constructor.
 
Method Summary
 Attribute[] directNonInteractiveAuthentication(java.lang.String[] attributes, java.lang.String username, java.lang.String password)
          Performs direct non-interactive authentication.
 java.lang.String getProxyTicket(java.lang.String ticketGrantingTicket, java.lang.String proxyServicePrincipal)
          Gets a proxy ticket.
 Attribute[] getUserAttributes(java.lang.String serviceTicket)
          Gets user attributes.
 java.lang.String initiateAuthentication(java.lang.String[] attributes, java.lang.String returnURLPrefix, java.lang.String returnURLPostfix, boolean forceInteractiveAuthentication)
          Initiates authentication.
private  Attribute[] mapToAttributeArray(java.util.Map map, java.lang.String activeTicketId)
          Utility method to convert a Map to an array of Attributes.
 Attribute[] proxyAuthentication(java.lang.String[] attributes, java.lang.String proxyTicket)
          Performs proxy authentication.
 boolean verifyUserExistence(java.lang.String username)
          Verifies the existence of a given user in the underlying directories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageLogger

private no.feide.moria.log.MessageLogger messageLogger
Class wide logger.


AUTHZ_EX_MESSAGE

private static final java.lang.String AUTHZ_EX_MESSAGE
Log message for AuthorizationExceptions.

See Also:
Constant Field Values

AUTHN_EX_MSG

private static final java.lang.String AUTHN_EX_MSG
Log message for AuthenticationExceptions.

See Also:
Constant Field Values

DIR_UNAV_EX_MSG

private static final java.lang.String DIR_UNAV_EX_MSG
Log message for DirectoryUnavailableExceptions.

See Also:
Constant Field Values

MORIACTRL_EX_MESSAGE

private static final java.lang.String MORIACTRL_EX_MESSAGE
Log message for MoriaControllerExceptions.

See Also:
Constant Field Values

INOP_STATE_EX_MSG

private static final java.lang.String INOP_STATE_EX_MSG
Log message for InoperableStateExceptions.

See Also:
Constant Field Values

UNKNOWN_TICKET_EX_MSG

private static final java.lang.String UNKNOWN_TICKET_EX_MSG
Log message for UnknownTicketExceptions.

See Also:
Constant Field Values
Constructor Detail

AuthenticationImpl

public AuthenticationImpl()
Default constructor. Initializes the message logger.

Method Detail

initiateAuthentication

public java.lang.String initiateAuthentication(java.lang.String[] attributes,
                                               java.lang.String returnURLPrefix,
                                               java.lang.String returnURLPostfix,
                                               boolean forceInteractiveAuthentication)
                                        throws SOAPException
Description copied from interface: Authentication
Initiates authentication. The initial call done by a service to start a login attempt.

Specified by:
initiateAuthentication in interface Authentication
Parameters:
attributes - The attributes the service wants returned on login
returnURLPrefix - The prefix of the url the user is to be returned to
returnURLPostfix - The optional postfix of the return url
forceInteractiveAuthentication - Whether or not cookie based authentication (SSO Light) should be allowed.
Returns:
The Moria url the client is to be redirected to.
Throws:
SOAPException - If anything fails during the call.
See Also:
Authentication.initiateAuthentication(java.lang.String[], java.lang.String, java.lang.String, boolean)

directNonInteractiveAuthentication

public Attribute[] directNonInteractiveAuthentication(java.lang.String[] attributes,
                                                      java.lang.String username,
                                                      java.lang.String password)
                                               throws SOAPException
Description copied from interface: Authentication
Performs direct non-interactive authentication. A redirect- and html-less login method. Only to be used in special cases where the client for some reason does not support the standard login procedure. Inherently insecure as the service will have knowledge of the plaintext password.

Specified by:
directNonInteractiveAuthentication in interface Authentication
Parameters:
attributes - The attributes the service wants returned on login.
username - The user name of the user to be authenticated.
password - The password of the user to be authenticated.
Returns:
Array of attributes as requested.
Throws:
SOAPException - If anything fails during the call.
See Also:
Authentication.directNonInteractiveAuthentication(java.lang.String[], java.lang.String, java.lang.String)

proxyAuthentication

public Attribute[] proxyAuthentication(java.lang.String[] attributes,
                                       java.lang.String proxyTicket)
                                throws SOAPException
Description copied from interface: Authentication
Performs proxy authentication. Called by a subsystem to authenticate a user.

Specified by:
proxyAuthentication in interface Authentication
Parameters:
attributes - The attributes the service wants returned on login.
proxyTicket - The proxy ticket given to the calling system by its initiator.
Returns:
Array of attributes as requested.
Throws:
SOAPException - If anything fails during the call.
See Also:
Authentication.proxyAuthentication(java.lang.String[], java.lang.String)

getProxyTicket

public java.lang.String getProxyTicket(java.lang.String ticketGrantingTicket,
                                       java.lang.String proxyServicePrincipal)
                                throws SOAPException
Description copied from interface: Authentication
Gets a proxy ticket. A service may as part of the initial attribute request ask for a ticket granting ticket that later may be used in this call. The returned proxy ticket is to be handed over to the specified underlying system and may be used by that system only to authenticate the request.

Specified by:
getProxyTicket in interface Authentication
Parameters:
ticketGrantingTicket - A TGT that has been issued previously.
proxyServicePrincipal - The service which the proxy ticket should be issued for.
Returns:
A proxy ticket.
Throws:
SOAPException - If anything fails during the call.
See Also:
Authentication.getProxyTicket(java.lang.String, java.lang.String)

getUserAttributes

public Attribute[] getUserAttributes(java.lang.String serviceTicket)
                              throws AuthorizationFailedException,
                                     IllegalInputException,
                                     InternalException,
                                     UnknownTicketException
Description copied from interface: Authentication
Gets user attributes. Called by the service when the user returns after a successful login.

Specified by:
getUserAttributes in interface Authentication
Parameters:
serviceTicket - The ticket included in the return request issued by the client.
Returns:
Array of attributes as requested in initiateAuthentication.
Throws:
AuthorizationFailedException
IllegalInputException
InternalException
UnknownTicketException
See Also:
Authentication.getUserAttributes(java.lang.String)

verifyUserExistence

public boolean verifyUserExistence(java.lang.String username)
                            throws SOAPException
Description copied from interface: Authentication
Verifies the existence of a given user in the underlying directories.

Specified by:
verifyUserExistence in interface Authentication
Parameters:
username - The username to be validated.
Returns:
true if the user is found.
Throws:
SOAPException - If anything fails during the call.
See Also:
Authentication.verifyUserExistence(java.lang.String)

mapToAttributeArray

private Attribute[] mapToAttributeArray(java.util.Map map,
                                        java.lang.String activeTicketId)
Utility method to convert a Map to an array of Attributes.

Parameters:
map - The Map to be converted.
activeTicketId - Optional variable for logging purposes.
Returns:
Array of Attribute objects.


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.