no.feide.mellon.v2_1
Class Moria

java.lang.Object
  extended by no.feide.mellon.v2_1.Moria

public class Moria
extends java.lang.Object

A client-side Moria2 v2.1 API, hiding the internals of generated stub usage.


Field Summary
private  AuthenticationSoapBindingStub moria2
          Internal representation of the Moria2 service.
 
Constructor Summary
Moria(java.lang.String endpoint, java.lang.String username, java.lang.String password)
           
 
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.
 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

moria2

private AuthenticationSoapBindingStub moria2
Internal representation of the Moria2 service.

Constructor Detail

Moria

public Moria(java.lang.String endpoint,
             java.lang.String username,
             java.lang.String password)
      throws java.lang.IllegalArgumentException,
             java.net.MalformedURLException,
             MoriaException
Parameters:
endpoint - The Moria2 service endpoint URL. Must be a non-empty string.
username - The client service's username, which is used by Moria2 to check the service's right to read attributes and perform operations. Must be a non-empty string.
password - The client service's password, which is used by Moria2 to check the service's right to read attributes and perform operations. Must be a non-empty string.
Throws:
java.lang.IllegalArgumentException - If endpoint,username or password is null or an empty string.
java.net.MalformedURLException - If the URL given by endpoint is malformed.
MoriaException - If unable to instantiate a client-side stub to the Moria2 endpoint.
Method Detail

getUserAttributes

public Attribute[] getUserAttributes(java.lang.String serviceTicket)
                              throws java.rmi.RemoteException,
                                     InternalException,
                                     IllegalInputException,
                                     UnknownTicketException,
                                     AuthorizationFailedException
Gets user attributes. Called by the service when the user returns after a successful login.

Parameters:
serviceTicket - The ticket included in the return request issued by the client.
Returns:
Array of attributes as requested in initiateAuthentication.
Throws:
java.rmi.RemoteException - If an exception occurs in the underlying SOAP layer.
AuthorizationFailedException - If the service is now allowed to perform this operation.
IllegalInputException - If the method is called with an illegal parameter.
InternalException - If an internal problem prevents Moria2 from performing this operation.
UnknownTicketException - If the service ticket given by serviceTicket does not match an existing or valid session.

initiateAuthentication

public java.lang.String initiateAuthentication(java.lang.String[] attributes,
                                               java.lang.String returnURLPrefix,
                                               java.lang.String returnURLPostfix,
                                               boolean forceInteractiveAuthentication)
                                        throws java.rmi.RemoteException,
                                               InternalException,
                                               IllegalInputException,
                                               AuthorizationFailedException
Initiates authentication. This is the initial call done by a service to start a login attempt.

Parameters:
attributes - The attributes the service wants returned on login.
returnURLPrefix - The prefix of the URL the user is to be returned to after successful authentication.
returnURLPostfix - The optional postfix of the return URL.
forceInteractiveAuthentication - If true, user is forced through authentication even if SSO is possible.
Returns:
An URL to which the client is to be redirected to for authentication.
Throws:
java.rmi.RemoteException - If an exception occurs in the underlying SOAP layer.
AuthorizationFailedException - If the service is now allowed to perform this operation, or if the service is not allowed to read one or more of the requested attributes.
IllegalInputException - If the method is called with illegal parameters, such as a returnURLPrefix/ returnURLPostfix combination that does not yield a valid URL.
InternalException - If an internal problem prevents Moria2 from performing this operation.

directNonInteractiveAuthentication

public Attribute[] directNonInteractiveAuthentication(java.lang.String[] attributes,
                                                      java.lang.String username,
                                                      java.lang.String password)
                                               throws java.rmi.RemoteException,
                                                      InternalException,
                                                      IllegalInputException,
                                                      AuthenticationFailedException,
                                                      AuthorizationFailedException,
                                                      AuthenticationUnavailableException
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.

Parameters:
attributes - The attributes the service wants returned following authentication.
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:
java.rmi.RemoteException - If an exception occurs in the underlying SOAP layer.
AuthorizationFailedException - If the service is now allowed to perform this operation, or if the service is not allowed to read one or more of the requested attributes.
AuthenticationFailedException - If the user credentials (given by username/ password) are not valid.
AuthenticationUnavailableException - If the third-party authentication server responsible for authenticating this user is not available.
IllegalInputException - If the method is called with illegal parameters.
InternalException - If an internal problem prevents Moria2 from performing this operation.

proxyAuthentication

public Attribute[] proxyAuthentication(java.lang.String[] attributes,
                                       java.lang.String proxyTicket)
                                throws java.rmi.RemoteException,
                                       InternalException,
                                       IllegalInputException,
                                       UnknownTicketException,
                                       AuthorizationFailedException
Performs proxy authentication. Called by a subsystem to authenticate a user.

Parameters:
attributes - The attributes the service wants returned following proxy authentication.
proxyTicket - The proxy ticket given to the calling system by its initiator.
Returns:
Array of attributes as requested.
Throws:
java.rmi.RemoteException - If an exception occurs in the underlying SOAP layer.
AuthorizationFailedException - If the service is now allowed to perform this operation, or if the service is not allowed to read one or more of the requested attributes.
IllegalInputException - If the method is called with illegal parameters.
InternalException - If an internal problem prevents Moria2 from performing this operation.
UnknownTicketException - If the proxy ticket given by proxyTicket does not match an existing and valid session.

getProxyTicket

public java.lang.String getProxyTicket(java.lang.String ticketGrantingTicket,
                                       java.lang.String proxyServicePrincipal)
                                throws java.rmi.RemoteException,
                                       InternalException,
                                       IllegalInputException,
                                       UnknownTicketException,
                                       AuthorizationFailedException
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.

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:
java.rmi.RemoteException - If an exception occurs in the underlying SOAP layer.
AuthorizationFailedException - If the service is now allowed to perform this operation.
IllegalInputException - If the method is called with illegal parameters.
InternalException - If an internal problem prevents Moria2 from performing this operation.
UnknownTicketException - If the ticket granting ticket given by ticketGrantingTicket does not match an existing and valid session.

verifyUserExistence

public boolean verifyUserExistence(java.lang.String username)
                            throws java.rmi.RemoteException,
                                   InternalException,
                                   IllegalInputException,
                                   AuthorizationFailedException,
                                   AuthenticationUnavailableException
Verifies the existence of a given user in the underlying directories.

Parameters:
username - The username to be validated.
Returns:
true if the user is found, otherwise false.
Throws:
java.rmi.RemoteException - If an exception occurs in the underlying SOAP layer.
AuthorizationFailedException - If the service is now allowed to perform this operation.
AuthenticationUnavailableException - If the authentication server where this user belongs is not available.
IllegalInputException - If the method is called with an illegal parameter.
InternalException - If an internal problem prevents Moria2 from performing this operation.


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