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

java.lang.Object
  extended by org.jasig.portal.security.LocalConnectionContext
      extended by org.jasig.portal.security.provider.cas.CasConnectionContext

public class CasConnectionContext
extends LocalConnectionContext

A LocalConnectionContext using the Central Authentication Service. This connection context places CAS proxy tickets on the URLs it processes. It searches for and uses any security context implementing ICasSecurityContext. This means that it supports both the filtered and the traditional CAS security context approaches and that this connection context can be used with any other security context scheme implementing CAS-like proxy ticket functionality if the corresponding security context implements ICasSecurityContext.


Field Summary
private  ICasSecurityContext casSecurityContext
           
private  IPerson person
           
private  ChannelStaticData staticData
           
 
Fields inherited from class org.jasig.portal.security.LocalConnectionContext
log
 
Constructor Summary
CasConnectionContext()
           
 
Method Summary
 java.lang.String getDescriptor(java.lang.String descriptor)
          Returns url with proxy service ticket appended.
 java.lang.String getDescriptor(java.lang.String descriptor, ChannelRuntimeData rd)
          Returns a descriptor such as a URL for opening a connection to the backend application.
 java.lang.String getPostData(ChannelRuntimeData rd)
          Get the "ticket={ticket}" parameter String given a ChannelRuntimeData containing a parameter declaring the service for which a proxy ticket is desired.
 void init(ChannelStaticData sd)
          Initialize LocalConnectionContext by setting static data.
 void sendLocalData(java.lang.Object conParam, ChannelRuntimeData rd)
          Send any per-connection local data to the backend application.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

staticData

private ChannelStaticData staticData

person

private IPerson person

casSecurityContext

private ICasSecurityContext casSecurityContext
Constructor Detail

CasConnectionContext

public CasConnectionContext()
Method Detail

init

public void init(ChannelStaticData sd)
Description copied from class: LocalConnectionContext
Initialize LocalConnectionContext by setting static data. Parameters may be passed to the implementing class via static data (which includes access to IPerson). Must always be called before sendLocalData.

Overrides:
init in class LocalConnectionContext
Parameters:
sd - The calling channel's ChannelStaticData.

getDescriptor

public java.lang.String getDescriptor(java.lang.String descriptor,
                                      ChannelRuntimeData rd)
Description copied from class: LocalConnectionContext
Returns a descriptor such as a URL for opening a connection to the backend application. The descriptor should be modified as necessary, for example modifying the a URL to include new query string parameters.

Overrides:
getDescriptor in class LocalConnectionContext
Parameters:
descriptor - The original descriptor.
rd - The calling channel's ChannelRuntimeData.

getDescriptor

public java.lang.String getDescriptor(java.lang.String descriptor)
Returns url with proxy service ticket appended. Looks for static parameter upc_cas_service_uri and uses that for service. If not specified, uses the passed uri

Parameters:
descriptor - The original descriptor.
Returns:
descriptor with CAS proxy ticket parameter appended.

getPostData

public java.lang.String getPostData(ChannelRuntimeData rd)
Get the "ticket={ticket}" parameter String given a ChannelRuntimeData containing a parameter declaring the service for which a proxy ticket is desired. If the ChannelRuntimeData presents the parameter "cw_xml", this method returns "ticket={ticket}" where {ticket} is a proxy ticket authenticating to the service specified by the cw_xml ChannelRuntimeData parameter. If the ChannelRuntimedata does not present the "cw_xml" parameter, this method returns "ticket=null".

Parameters:
rd - ChannelRuntimeData.
Returns:
"ticket={ticket}" where {ticket} is a proxy ticket or is "null".

sendLocalData

public void sendLocalData(java.lang.Object conParam,
                          ChannelRuntimeData rd)
Description copied from class: LocalConnectionContext
Send any per-connection local data to the backend application. E.g. headers in an http POST request. The default implementation does nothing.

Overrides:
sendLocalData in class LocalConnectionContext
Parameters:
conParam - The connection Object to the backend application (ie. HttpURLConnection, DirContext).
rd - The calling channel's ChannelRuntimeData.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object