org.jasig.portal.security.provider.cas
Class CasAssertionSecurityContext

java.lang.Object
  extended by org.jasig.portal.security.provider.ChainingSecurityContext
      extended by org.jasig.portal.security.provider.cas.CasAssertionSecurityContext
All Implemented Interfaces:
Serializable, ISecurityContext, ICasSecurityContext

public class CasAssertionSecurityContext
extends ChainingSecurityContext
implements ICasSecurityContext

Implementation of the ICasSecurityContext that reads the Assertion from the ThreadLocal. The Assertion stored in a ThreadLocal is an artifact of the Jasig CAS Client for Java 3.x library.

Since:
3.2
Version:
$Revision: 19776 $ $Date: 2010-01-14 16:17:21 -0600 (Thu, 14 Jan 2010) $
Author:
Scott Battaglia
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jasig.portal.security.provider.ChainingSecurityContext
ChainingSecurityContext.ChainingAdditionalDescriptor, ChainingSecurityContext.ChainingOpaqueCredentials, ChainingSecurityContext.ChainingPrincipal
 
Field Summary
 
Fields inherited from class org.jasig.portal.security.provider.ChainingSecurityContext
isauth, log, myAdditionalDescriptor, myOpaqueCredentials, myOrder, myPrincipal, mySubContexts, stopWhenAuthenticated
 
Fields inherited from interface org.jasig.portal.security.provider.cas.ICasSecurityContext
CAS_AUTHTYPE
 
Constructor Summary
CasAssertionSecurityContext()
           
 
Method Summary
 void authenticate()
          We walk the chain of subcontext assigning principals and opaquecredentials from the parent.
 int getAuthType()
          Returns the canonical authentication type for this flavor of authentication.
 String getCasServiceToken(String target)
          Get a proxy ticket for a given target.
protected  void postAuthenticate(org.jasig.cas.client.validation.Assertion assertion)
          Exposes a template post-authentication method for subclasses to implement their custom logic in.
 String toString()
           
 
Methods inherited from class org.jasig.portal.security.provider.ChainingSecurityContext
addSubContext, doesSubContextExist, getAdditionalDescriptor, getOpaqueCredentials, getOpaqueCredentialsInstance, getPrincipal, getPrincipalInstance, getSubContext, getSubContextNames, getSubContexts, isAuthenticated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CasAssertionSecurityContext

public CasAssertionSecurityContext()
Method Detail

getAuthType

public int getAuthType()
Description copied from interface: ISecurityContext
Returns the canonical authentication type for this flavor of authentication. Each value returned should be either a globally registered auth flavor or a local variant.

Specified by:
getAuthType in interface ISecurityContext
Returns:
The unique authentication value identifier. Values with the high order 16 bits clear are local (0x0000 - 0x00FF) where values with the high order 16 bits set (0xFF00 - 0xFFFF are foundation types distributed by JASIG. All other should be registered and globally unique.

postAuthenticate

protected void postAuthenticate(org.jasig.cas.client.validation.Assertion assertion)
Exposes a template post-authentication method for subclasses to implement their custom logic in.

NOTE: This is called BEFORE super.authenticate();

Parameters:
assertion - the Assertion that was retrieved from the ThreadLocal. CANNOT be NULL.

authenticate

public final void authenticate()
                        throws PortalSecurityException
Description copied from class: ChainingSecurityContext
We walk the chain of subcontext assigning principals and opaquecredentials from the parent. Note that the contexts themselves should resist actually performing the assignment if an assignment has already been made to either the credentials or the UID.

Specified by:
authenticate in interface ISecurityContext
Overrides:
authenticate in class ChainingSecurityContext
Throws:
PortalSecurityException
See Also:
ISecurityContext.getPrincipalInstance(), ISecurityContext.getOpaqueCredentialsInstance()

getCasServiceToken

public final String getCasServiceToken(String target)
                                throws CasProxyTicketAcquisitionException
Description copied from interface: ICasSecurityContext
Get a proxy ticket for a given target. Implementations should return null if no PGTIOU or PGT is available by which to obtain a proxy ticket. Implementations should throw a CASProxyTicketAcquisitionException if an error occurs during an attempt to obtain a PGT. In particular, inability to contact the CAS server and expiration of the underlying PGT should result in a CASProxyTicketAcquisitionException.

Specified by:
getCasServiceToken in interface ICasSecurityContext
Parameters:
target - - URL for which a proxy ticket is desired.
Returns:
a valid proxy ticket for the target, or null.
Throws:
CasProxyTicketAcquisitionException - - when unable to obtain Proxy Ticket.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010 Jasig. All Rights Reserved.