org.n52.security.authentication
Class SAMLTicket

java.lang.Object
  extended by org.n52.security.authentication.SAMLTicket

public class SAMLTicket
extends java.lang.Object

The SAMLTicket class basically provides a SAMLResponse <-> javax.security.auth.Subject mapping.


Field Summary
protected  org.opensaml.SAMLResponse m_samlResponse
           
 
Constructor Summary
SAMLTicket(org.w3c.dom.Document pSAMLResponse)
           
SAMLTicket(org.opensaml.SAMLResponse pSAMLResponse)
           
SAMLTicket(java.lang.String samlResponse)
           
 
Method Summary
 java.lang.String asBase64String()
           
 java.lang.String asString()
           
 javax.security.auth.Subject asSubject()
           
static java.lang.String createSAMLResponseFromPrincipals(AuthenticationContext authContext, java.lang.String pRoleAttributeName, java.lang.String pIssuer, java.lang.String pTarget, int pTimeout, java.lang.String pAuthentMethod, java.security.Key pPrivKey, java.security.cert.Certificate pCert, boolean pBase64)
           
 boolean isExpired()
          check if any assertion is expired, without any respect to clock differences.
 boolean isExpired(long allowedDelta)
          check if any assertion is expired, in relation to an allowed delta.
 void updateSubject(javax.security.auth.Subject pSubject)
           
 void verify()
          Verifies the signature of this SAML document.
 void verify(java.security.cert.Certificate pWASCert)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_samlResponse

protected org.opensaml.SAMLResponse m_samlResponse
Constructor Detail

SAMLTicket

public SAMLTicket(java.lang.String samlResponse)
           throws org.opensaml.SAMLException
Parameters:
samlResponse - String representation of an "UTF-8" coded SAMLTicket.
Throws:
org.opensaml.SAMLException

SAMLTicket

public SAMLTicket(org.w3c.dom.Document pSAMLResponse)
           throws org.opensaml.SAMLException
Parameters:
pSAMLResponse -
Throws:
org.opensaml.SAMLException

SAMLTicket

public SAMLTicket(org.opensaml.SAMLResponse pSAMLResponse)
           throws org.opensaml.SAMLException
Parameters:
pSAMLResponse -
Throws:
org.opensaml.SAMLException
Method Detail

verify

public void verify()
            throws org.opensaml.SAMLException
Verifies the signature of this SAML document.

Throws:
org.opensaml.SAMLException - if the signature could not be verified

verify

public void verify(java.security.cert.Certificate pWASCert)
            throws org.opensaml.SAMLException
Throws:
org.opensaml.SAMLException

isExpired

public boolean isExpired()
check if any assertion is expired, without any respect to clock differences.

Returns:
if ticket is expired.

isExpired

public boolean isExpired(long allowedDelta)
check if any assertion is expired, in relation to an allowed delta.

Parameters:
allowedDelta - a delta in msec.
Returns:
if ticket is expired.

asSubject

public javax.security.auth.Subject asSubject()
Returns:

asString

public java.lang.String asString()
Returns:

asBase64String

public java.lang.String asBase64String()
Returns:

updateSubject

public void updateSubject(javax.security.auth.Subject pSubject)
Parameters:
pSubject -

createSAMLResponseFromPrincipals

public static java.lang.String createSAMLResponseFromPrincipals(AuthenticationContext authContext,
                                                                java.lang.String pRoleAttributeName,
                                                                java.lang.String pIssuer,
                                                                java.lang.String pTarget,
                                                                int pTimeout,
                                                                java.lang.String pAuthentMethod,
                                                                java.security.Key pPrivKey,
                                                                java.security.cert.Certificate pCert,
                                                                boolean pBase64)
                                                         throws org.opensaml.SAMLException,
                                                                java.io.IOException
Parameters:
pUsernameID -
pAttributes -
Returns:
Throws:
org.opensaml.SAMLException
java.io.IOException


Copyright © 2004-2009 52north.org. All Rights Reserved.