org.apache.cxf.sts.token.validator
Class SAMLTokenValidator

java.lang.Object
  extended by org.apache.cxf.sts.token.validator.SAMLTokenValidator
All Implemented Interfaces:
TokenValidator

public class SAMLTokenValidator
extends Object
implements TokenValidator

Validate a SAML Assertion. It is valid if it was issued and signed by this STS.


Constructor Summary
SAMLTokenValidator()
           
 
Method Summary
 boolean canHandleToken(ReceivedToken validateTarget)
          Return true if this TokenValidator implementation is capable of validating the ReceivedToken argument.
 boolean canHandleToken(ReceivedToken validateTarget, String realm)
          Return true if this TokenValidator implementation is capable of validating the ReceivedToken argument.
 void setSamlRealmCodec(SAMLRealmCodec samlRealmCodec)
          Set the SAMLRealmCodec instance to use to return a realm from a validated token
 void setSubjectConstraints(List<String> subjectConstraints)
          Set a list of Strings corresponding to regular expression constraints on the subject DN of a certificate that was used to sign a received Assertion
 void setValidator(org.apache.ws.security.validate.Validator validator)
          Set the WSS4J Validator instance to use to validate the token.
protected  void validateAssertion(org.apache.ws.security.saml.ext.AssertionWrapper assertion)
          Validate the assertion against schemas/profiles
protected  boolean validateConditions(org.apache.ws.security.saml.ext.AssertionWrapper assertion, ReceivedToken validateTarget)
           
 TokenValidatorResponse validateToken(TokenValidatorParameters tokenParameters)
          Validate a Token using the given TokenValidatorParameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMLTokenValidator

public SAMLTokenValidator()
Method Detail

setSubjectConstraints

public void setSubjectConstraints(List<String> subjectConstraints)
Set a list of Strings corresponding to regular expression constraints on the subject DN of a certificate that was used to sign a received Assertion


setValidator

public void setValidator(org.apache.ws.security.validate.Validator validator)
Set the WSS4J Validator instance to use to validate the token.

Parameters:
validator - the WSS4J Validator instance to use to validate the token

setSamlRealmCodec

public void setSamlRealmCodec(SAMLRealmCodec samlRealmCodec)
Set the SAMLRealmCodec instance to use to return a realm from a validated token

Parameters:
samlRealmCodec - the SAMLRealmCodec instance to use to return a realm from a validated token

canHandleToken

public boolean canHandleToken(ReceivedToken validateTarget)
Return true if this TokenValidator implementation is capable of validating the ReceivedToken argument.

Specified by:
canHandleToken in interface TokenValidator

canHandleToken

public boolean canHandleToken(ReceivedToken validateTarget,
                              String realm)
Return true if this TokenValidator implementation is capable of validating the ReceivedToken argument. The realm is ignored in this Validator.

Specified by:
canHandleToken in interface TokenValidator

validateToken

public TokenValidatorResponse validateToken(TokenValidatorParameters tokenParameters)
Validate a Token using the given TokenValidatorParameters.

Specified by:
validateToken in interface TokenValidator

validateAssertion

protected void validateAssertion(org.apache.ws.security.saml.ext.AssertionWrapper assertion)
                          throws org.apache.ws.security.WSSecurityException
Validate the assertion against schemas/profiles

Throws:
org.apache.ws.security.WSSecurityException

validateConditions

protected boolean validateConditions(org.apache.ws.security.saml.ext.AssertionWrapper assertion,
                                     ReceivedToken validateTarget)


Apache CXF