no.feide.moria.store
Interface MoriaStore

All Known Implementing Classes:
MoriaCacheStore

public interface MoriaStore

The store manager's main functionality is to handle tickets. The interface makes it possible to create tickets and store them and their associated data. The interface also has support for removal of expired tickets.

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

Method Summary
 java.lang.String cacheUserData(java.util.HashMap attributes, java.lang.String userorg)
          Creates a new CachedUserData object in the underlying store and associates it with an SSO ticket which is returned.
 java.lang.String createAuthnAttempt(java.lang.String[] requestAttributes, java.lang.String responseURLPrefix, java.lang.String responseURLPostfix, boolean forceInteractiveAuthentication, java.lang.String servicePrincipal)
          Creates an authentication attempt based on a service request.
 java.lang.String createProxyTicket(java.lang.String tgTicketId, java.lang.String servicePrincipal, java.lang.String targetServicePrincipal)
          Creates a new proxy ticket from a TGT and associates the new ticket with the same user data as the TGT.
 java.lang.String createServiceTicket(java.lang.String loginTicketId)
          Creates a service ticket that the service will use when requesting user attributes after a successful authentication.
 java.lang.String createTicketGrantingTicket(java.lang.String ssoTicketId, java.lang.String targetServicePrincipal)
          Creates a new ticket granting ticket, using an sso ticket.
 MoriaAuthnAttempt getAuthnAttempt(java.lang.String ticketId, boolean keep, java.lang.String servicePrincipal)
          Gets the authentication attempt associated with the ticket given as argument.
 java.lang.String getTicketServicePrincipal(java.lang.String ticketId, MoriaTicketType ticketType)
          Returns the service principal for the ticket.
 java.lang.String getTicketUserorg(java.lang.String ticketId, MoriaTicketType ticketType)
          Gets the userorg of a ticket.
 CachedUserData getUserData(java.lang.String proxyTicketId, java.lang.String servicePrincipal)
          Returns the userdata associated with the incoming ticket, which must be either a proxy ticket, an SSO ticket or ticket granting ticket.
 void removeSSOTicket(java.lang.String ssoTicketId)
          Removes an SSO ticket from the store.
 void setConfig(java.util.Properties properties)
          Sets the configuration of the store.
 void setTicketUserorg(java.lang.String ticketId, MoriaTicketType ticketType, java.lang.String userorg)
          Sets the userorg of a ticket.
 void setTransientAttributes(java.lang.String loginTicketId, java.util.HashMap transientAttributes)
          Sets transient attributes stored with authentication attempt.
 void setTransientSSOAttributes(java.lang.String loginTicketId, java.lang.String ssoTicketId, java.lang.String[] ssoEnabledAttributeNames)
          Sets transient attributes stored with authentication attempt, copied from a cached user data object.
 void stop()
          Stops this instance of the store.
 

Method Detail

setConfig

void setConfig(java.util.Properties properties)
               throws MoriaStoreConfigurationException
Sets the configuration of the store.

Parameters:
properties - Object containing the necessary attributes for store configuration.
Throws:
MoriaStoreConfigurationException - If the store cannot be started with the given configuration.
java.lang.IllegalArgumentException - If properties is null.

stop

void stop()
Stops this instance of the store.


createAuthnAttempt

java.lang.String createAuthnAttempt(java.lang.String[] requestAttributes,
                                    java.lang.String responseURLPrefix,
                                    java.lang.String responseURLPostfix,
                                    boolean forceInteractiveAuthentication,
                                    java.lang.String servicePrincipal)
                                    throws MoriaStoreException
Creates an authentication attempt based on a service request.

Parameters:
requestAttributes - The user attributes the requesting service asks for.
responseURLPrefix - The forward part of the url the client is to be redirected to.
responseURLPostfix - The end part of the url the client is to be redirected to.
forceInteractiveAuthentication - If the user should be forced to login interactively. I.e. disable support for single sign-on.
servicePrincipal - The id of the service doing the request.
Returns:
A login ticket identifying the authentication attempt.
Throws:
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If any of the arguments are null, and if responseURLPrefix or servicePrincipal are zero length.

getAuthnAttempt

MoriaAuthnAttempt getAuthnAttempt(java.lang.String ticketId,
                                  boolean keep,
                                  java.lang.String servicePrincipal)
                                  throws InvalidTicketException,
                                         NonExistentTicketException,
                                         MoriaStoreException
Gets the authentication attempt associated with the ticket given as argument.

Parameters:
ticketId - the ticket from the incoming client request (must be LOGIN or SERVICE)
keep - if true the authnAttempt and ticket will be kept in the store after this operation
servicePrincipal - the principal of the service requesting the operation (null if login ticket is supplied)
Returns:
the MoriaAuthnAttempt associated with the ticket
Throws:
InvalidTicketException - if the incoming ticket is found to be invalid
NonExistentTicketException - If ticket does not exist
MoriaStoreException - If the operation fails
java.lang.IllegalArgumentException - If ticketId is null or zero length and if no servicePrincipal is supplied with a service ticket

cacheUserData

java.lang.String cacheUserData(java.util.HashMap attributes,
                               java.lang.String userorg)
                               throws MoriaStoreException
Creates a new CachedUserData object in the underlying store and associates it with an SSO ticket which is returned.

Parameters:
attributes - The attribute map to be cached.
userorg - The userorg that is to be associated with the ticket.
Returns:
The SSO ticket that identifies the cached user data.
Throws:
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If attributes is null, or userorg is null or an empty string.

getUserData

CachedUserData getUserData(java.lang.String proxyTicketId,
                           java.lang.String servicePrincipal)
                           throws InvalidTicketException,
                                  NonExistentTicketException,
                                  MoriaStoreException
Returns the userdata associated with the incoming ticket, which must be either a proxy ticket, an SSO ticket or ticket granting ticket.

Parameters:
proxyTicketId - A ticket to identify a userdata object (SSO, TGT or PROXY).
servicePrincipal - The name of the service requesting the data,
Returns:
A clone of the object containing the userdata.
Throws:
InvalidTicketException - If the incoming ticket is not of the correct type or has an invalid principal.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If ticketId is null or zero length, or SSO ticket principal is null or zero length.

createServiceTicket

java.lang.String createServiceTicket(java.lang.String loginTicketId)
                                     throws InvalidTicketException,
                                            NonExistentTicketException,
                                            MoriaStoreException
Creates a service ticket that the service will use when requesting user attributes after a successful authentication.

Parameters:
loginTicketId - A login ticket associated with an authentication attempt.
Returns:
A service ticket associated with the authentication attempt object.
Throws:
InvalidTicketException - If the supplied ticket is not a login ticket.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If loginTicketId is null or zero length.

createTicketGrantingTicket

java.lang.String createTicketGrantingTicket(java.lang.String ssoTicketId,
                                            java.lang.String targetServicePrincipal)
                                            throws InvalidTicketException,
                                                   NonExistentTicketException,
                                                   MoriaStoreException
Creates a new ticket granting ticket, using an sso ticket.

Parameters:
ssoTicketId - An sso ticket that is already associated with a cached userdata object.
targetServicePrincipal - The id of the service that will use the TGT.
Returns:
A ticket-granting ticket that the requesting service may use for later proxy authentication.
Throws:
InvalidTicketException - If the argument ticket is not an SSO ticket or has an invalid principal.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If any of the arguments are null or zero length.

createProxyTicket

java.lang.String createProxyTicket(java.lang.String tgTicketId,
                                   java.lang.String servicePrincipal,
                                   java.lang.String targetServicePrincipal)
                                   throws InvalidTicketException,
                                          NonExistentTicketException,
                                          MoriaStoreException
Creates a new proxy ticket from a TGT and associates the new ticket with the same user data as the TGT.

Parameters:
tgTicketId - A TGT issued earlier to a service.
servicePrincipal - The id of the service making the request.
targetServicePrincipal - The id of the service that will use the proxy ticket.
Returns:
Proxy ticket that may be used by the requesting service.
Throws:
InvalidTicketException - If the incoming ticket is not a TGT or has an invalid principal.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If any of the arguments are null or zero length.

setTransientAttributes

void setTransientAttributes(java.lang.String loginTicketId,
                            java.util.HashMap transientAttributes)
                            throws InvalidTicketException,
                                   NonExistentTicketException,
                                   MoriaStoreException
Sets transient attributes stored with authentication attempt.

Parameters:
loginTicketId - Ticket that identifies the AuthnAttempt that the attributes will be associated with.
transientAttributes - Attributes to store with the AuthnAttempt.
Throws:
InvalidTicketException - If ticket is found invalid.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If loginTicketId is null or zero length, or transientAttributes is null.

setTransientSSOAttributes

void setTransientSSOAttributes(java.lang.String loginTicketId,
                               java.lang.String ssoTicketId,
                               java.lang.String[] ssoEnabledAttributeNames)
                               throws InvalidTicketException,
                                      NonExistentTicketException,
                                      MoriaStoreException
Sets transient attributes stored with authentication attempt, copied from a cached user data object.

Parameters:
loginTicketId - Ticket that identifies the AuthnAttempt that the attributes will be associated with.
ssoTicketId - Ticket associated with a set of cached user data.
ssoEnabledAttributeNames - The names of those attributes which should be stored with the authentication attempt; should include only those attributes the service is allowed to use in an SSO context.
Throws:
InvalidTicketException - If either ticket is found invalid.
NonExistentTicketException - If either ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If either ticket id is null or zero length.

removeSSOTicket

void removeSSOTicket(java.lang.String ssoTicketId)
                     throws NonExistentTicketException,
                            MoriaStoreException
Removes an SSO ticket from the store.

Parameters:
ssoTicketId - the ticketId of the ticket to remove
Throws:
NonExistentTicketException - If ticket does not exist
MoriaStoreException - If the operation fails
java.lang.IllegalArgumentException - If ssoTicketId is null or zero length

getTicketServicePrincipal

java.lang.String getTicketServicePrincipal(java.lang.String ticketId,
                                           MoriaTicketType ticketType)
                                           throws InvalidTicketException,
                                                  NonExistentTicketException,
                                                  MoriaStoreException
Returns the service principal for the ticket.

Parameters:
ticketId - The ticket id.
ticketType - The ticket type.
Returns:
Service principal.
Throws:
InvalidTicketException - If the ticket is invalid.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If ticketId is null or zero length.

setTicketUserorg

void setTicketUserorg(java.lang.String ticketId,
                      MoriaTicketType ticketType,
                      java.lang.String userorg)
                      throws InvalidTicketException,
                             NonExistentTicketException,
                             MoriaStoreException
Sets the userorg of a ticket.

Parameters:
ticketId - The ticket id.
ticketType - The ticket type.
userorg - The userorg of the user creating the ticket.
Throws:
InvalidTicketException - if the ticket is invalid.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If ticketId is null or zero length.

getTicketUserorg

java.lang.String getTicketUserorg(java.lang.String ticketId,
                                  MoriaTicketType ticketType)
                                  throws InvalidTicketException,
                                         NonExistentTicketException,
                                         MoriaStoreException
Gets the userorg of a ticket.

Parameters:
ticketId - the ticket id.
ticketType - the ticket type.
Returns:
the organization of the user creating the ticket, or null if not set.
Throws:
InvalidTicketException - If the ticket is invalid.
NonExistentTicketException - If ticket does not exist.
MoriaStoreException - If the operation fails.
java.lang.IllegalArgumentException - If ticketId is null or zero length.


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