issrg.shibboleth
Class ShibbolethPrincipal

java.lang.Object
  extended by issrg.shibboleth.ShibbolethPrincipal
All Implemented Interfaces:
Entry, java.security.Principal

public class ShibbolethPrincipal
extends java.lang.Object
implements java.security.Principal, Entry

This class is used to represent a Principal obtained from Shibboleth attributes. The attribute format is determined by the way Shibboleth SP exports the values obtained from SAML into Apache headers.

Shibboleth attributes don't contain the name of the holder, but contain the identifier of the issuer - the scope. Therefore ShibbolethPrincipal represents the Entry of the issuer and the attributes issued to another entity.


Constructor Summary
protected ShibbolethPrincipal()
           
  ShibbolethPrincipal(java.lang.String url)
          This constructor can be used to construct Shibboleth Principal using a URL.
 
Method Summary
 java.lang.String getAttributeType()
          This method returns the attribute type as obtained from the URL at construction time.
 java.lang.String getAttributeValue()
          This method returns the attribute value as obtained from the URL at construction time.
 java.security.Principal getEntryName()
          This method returns the Principal of the issuer Entry.
 Entry getIssuerEntry()
          This method returns the Entry representing the issuer.
 java.lang.String getName()
          When used as an Entry, this method returns the name; i.e. the name of the issuer as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Constructor Detail

ShibbolethPrincipal

protected ShibbolethPrincipal()

ShibbolethPrincipal

public ShibbolethPrincipal(java.lang.String url)
                    throws BadURLException
This constructor can be used to construct Shibboleth Principal using a URL. It will identify the ISSUER of a Shibboleth attribute.

The format of this URL is as follows: "shib:" [<attribute type>=<attribute value>@] <domain>

If attribute type and value are present, they are extracted. Otherwise, the URL identifies the Domain and is rendered to be the Issuer of the attribute.

Parameters:
url - - the URL, as specified above
Throws:
BadURLException - if the URL doesn't correspond to this syntax
Method Detail

getEntryName

public java.security.Principal getEntryName()
This method returns the Principal of the issuer Entry.

Specified by:
getEntryName in interface Entry
Returns:
Principal representing the Issuer Entry

getName

public java.lang.String getName()
When used as an Entry, this method returns the name; i.e. the name of the issuer as a String.

Specified by:
getName in interface java.security.Principal

getIssuerEntry

public Entry getIssuerEntry()
This method returns the Entry representing the issuer.


getAttributeType

public java.lang.String getAttributeType()
This method returns the attribute type as obtained from the URL at construction time.

Returns:
attribute type; may be null, if the URL did not contain any attribute

getAttributeValue

public java.lang.String getAttributeValue()
This method returns the attribute value as obtained from the URL at construction time.

Returns:
attribute value; may be null, if the URL did not contain any attribute