Package com.sun.xml.wss.saml
Class SAMLAssertionFactory
java.lang.Object
com.sun.xml.wss.saml.SAMLAssertionFactory
- Direct Known Subclasses:
SAMLAssertion2_1FactoryImpl,SAMLAssertion2_2FactoryImpl
- Author:
- abhijit.das@Sun.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ActioncreateAction(String action, String namespace) Creates anActionelement.abstract AdvicecreateAdvice(List assertionidreference, List assertion, List otherelement) Creates anAdviceelement.abstract AnyTypeCreates anAnyTypeelement if the System property "com.sun.xml.wss.saml.binding.jaxb" is set.abstract AssertioncreateAssertion(String ID, NameID issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, Subject subject, List statements) Creates and return an Assertion from the data members: theID, the issuer, time when assertion issued, the conditions when creating a new assertion ,Adviceapplicable to thisAssertion,Subjectand a set ofStatement(s) in the assertion.abstract AssertioncreateAssertion(String ID, NameID issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, Subject subject, List statements, jakarta.xml.bind.JAXBContext jcc) Creates and return an Assertion from the data members: theID, the issuer, time when assertion issued, the conditions when creating a new assertion ,Adviceapplicable to thisAssertion,Subject, a set ofStatement(s) ,and a jaxbcontext for the assertion.abstract AssertioncreateAssertion(String assertionID, String issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, List statements) Creates and return an Assertion from the data members: theassertionID, the issuer, time when assertion issued, the conditions when creating a new assertion ,Adviceapplicable to thisAssertionand a set ofStatement(s) in the assertion.abstract AssertioncreateAssertion(String assertionID, String issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, List statements, jakarta.xml.bind.JAXBContext jcc) abstract AssertioncreateAssertion(XMLStreamReader reader) Creates and returns anAssertionobject from the given SAMLXMLStreamReader.abstract AssertioncreateAssertion(Element element) Creates and returns anAssertionobject from the given SAMLorg.w3c.dom.Element.abstract AssertionIDRefCreates and returns anAssertionIDRefobject.abstract AssertionIDRefCreates and returns anAssertionIDRefobject.abstract AssertionIDReferenceCreates and returns anAssertionIDReferenceobject.abstract AssertionIDReferenceCreates and returns anAssertionIDReferenceobject.abstract AttributecreateAttribute(String name, String nameSpace, List values) Constructs an instance ofAttribute.abstract AttributecreateAttribute(String name, List values) Constructs an instance ofAttribute.abstract AttributeDesignatorcreateAttributeDesignator(String name, String nameSpace) Constructs an instance ofAttributeDesignator.abstract AttributeStatementcreateAttributeStatement(Subject subj, List attr) Constructs an instance ofAttributeStatement.abstract AttributeStatementcreateAttributeStatement(List attr) Constructs an instance ofAttributeStatement.abstract AudienceRestrictioncreateAudienceRestriction(List audience) Constructs an instance ofAudienceRestriction.abstract AudienceRestrictionConditioncreateAudienceRestrictionCondition(List audience) Constructs an instance ofAudienceRestrictionCondition.abstract AuthenticationStatementcreateAuthenticationStatement(String authMethod, GregorianCalendar authInstant, Subject subject, SubjectLocality subjectLocality, List authorityBinding) Constructs an instance ofAuthenticationStatement.abstract AuthnContextabstract AuthnContextcreateAuthnContext(String authContextClassref, String authenticatingAuthority) abstract AuthnDecisionStatementcreateAuthnDecisionStatement(String resource, String decision, List action, Evidence evidence) Constructs an instance ofAuthnDecisionStatement.abstract AuthnStatementcreateAuthnStatement(GregorianCalendar authInstant, SubjectLocality subjectLocality, AuthnContext authnContext, String sessionIndex, GregorianCalendar sessionNotOnOrAfter) Constructs an instance ofAuthenticationStatement.abstract AuthorityBindingcreateAuthorityBinding(QName authKind, String location, String binding) Constructs an instance ofAuthorityBinding.abstract AuthorizationDecisionStatementcreateAuthorizationDecisionStatement(Subject subject, String resource, String decision, List action, Evidence evidence) Constructs an instance ofAuthorizationDecisionStatement.abstract ConditionsConstructs an instance of defaultConditionsobject.abstract ConditionscreateConditions(GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, List condition, List arc, List doNotCacheCnd) Constructs an instance ofConditions.abstract ConditionscreateConditions(GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, List condition, List ar, List oneTimeUse, List proxyRestriction) Constructs an instance ofConditions.abstract DoNotCacheConditionConstructs an instance ofDoNotCacheConditionabstract EvidencecreateEvidence(List assertionIDRef, List assertion) Constructs an Evidence from a List ofAssertionandAssertionIDReferenceobjects.abstract KeyInfoConfirmationDatacreateKeyInfoConfirmationData(Element keyInfo) abstract NameIDcreateNameID(String name, String nameQualifier, String format) Constructs aNameIDinstance.abstract NameIdentifiercreateNameIdentifier(String name, String nameQualifier, String format) Constructs aNameQualifierinstance.abstract OneTimeUseabstract SubjectcreateSubject(NameIdentifier nameIdentifier, SubjectConfirmation subjectConfirmation) Constructs a Subject object from aNameIdentifierobject and aSubjectConfirmationobject.abstract SubjectcreateSubject(NameID nameID, SubjectConfirmation subjectConfirmation) Constructs a Subject object from aNameIDobject and aSubjectConfirmationobject.abstract SubjectConfirmationcreateSubjectConfirmation(NameID nameID, KeyInfoConfirmationData keyInfoConfirmationData, String confirmationMethods) Constructs aSubjectConfirmationinstance.abstract SubjectConfirmationcreateSubjectConfirmation(NameID nameID, SubjectConfirmationData subjectConfirmationData, String confirmationMethods) Constructs aSubjectConfirmationinstance.abstract SubjectConfirmationcreateSubjectConfirmation(NameID nameID, String method) Creates and returns aSubjectConfirmationobject.abstract SubjectConfirmationcreateSubjectConfirmation(String confirmationMethod) Creates and returns aSubjectConfirmationobject.abstract SubjectConfirmationcreateSubjectConfirmation(List confirmationMethods, SubjectConfirmationData scd, KeyInfo keyInfo) abstract SubjectConfirmationcreateSubjectConfirmation(List confirmationMethods, Element subjectConfirmationData, Element keyInfo) Constructs aSubjectConfirmationinstance.abstract SubjectConfirmationDatacreateSubjectConfirmationData(String address, String inResponseTo, GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, String recipient, KeyInfo keyInfo) abstract SubjectConfirmationDatacreateSubjectConfirmationData(String address, String inResponseTo, GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, String recipient, Element keyInfo) abstract SubjectLocalityConstructs aSubjectLocalityinstance.abstract SubjectLocalitycreateSubjectLocality(String ipAddress, String dnsAddress) Constructs an instance ofSubjectLocality.static SAMLAssertionFactorynewInstance(String samlVersion) Create an instance of SAMLAssertionFactory.
-
Field Details
-
SAML1_1
SAML Version 1.1 & SAML Version 2.0- See Also:
-
SAML2_0
- See Also:
-
SAML_VER_CHECK
-
-
Constructor Details
-
SAMLAssertionFactory
protected SAMLAssertionFactory()
-
-
Method Details
-
newInstance
Create an instance of SAMLAssertionFactory.- Parameters:
samlVersion- A String representing the saml version. Possible values {SAMLAssertionFactory.SAML1_1} & {SAMLAssertionFactory.SAML2_0}- Throws:
XWSSecurityException
-
createAction
Creates anActionelement.- Parameters:
namespace- The attribute "namespace" ofActionelementaction- A String representing an action
-
createAdvice
Creates anAdviceelement.- Parameters:
assertionidreference- A List ofAssertionIDReference.assertion- A List of Assertionotherelement- A List of any element defined as
-
createAnyType
Creates anAnyTypeelement if the System property "com.sun.xml.wss.saml.binding.jaxb" is set. Otherwise returns null. -
createAssertion
public abstract Assertion createAssertion(String assertionID, String issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, List statements) throws SAMLException Creates and return an Assertion from the data members: theassertionID, the issuer, time when assertion issued, the conditions when creating a new assertion ,Adviceapplicable to thisAssertionand a set ofStatement(s) in the assertion.- Parameters:
assertionID-AssertionIDobject contained within thisAssertionif null its generated internally.issuer- The issuer of this assertion.issueInstant- Time instant of the issue. It has typedateTimewhich is built in to the W3C XML Schema Types specification. if null, current time is used.conditions-Conditionsunder which the thisAssertionis valid.advice-Adviceapplicable for thisAssertion.statements- List ofStatementobjects within thisAssertion. It could be of typeAuthenticationStatement,AuthorizationDecisionStatementandAttributeStatement. Each Assertion can have multiple type of statements in it.- Throws:
SAMLException- if there is an error in processing input.
-
createAssertion
public abstract Assertion createAssertion(String assertionID, String issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, List statements, jakarta.xml.bind.JAXBContext jcc) throws SAMLException - Throws:
SAMLException
-
createAssertion
public abstract Assertion createAssertion(String ID, NameID issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, Subject subject, List statements) throws SAMLException Creates and return an Assertion from the data members: theID, the issuer, time when assertion issued, the conditions when creating a new assertion ,Adviceapplicable to thisAssertion,Subjectand a set ofStatement(s) in the assertion.- Parameters:
ID-IDobject contained within thisAssertionif null its generated internally.issuer- The issuer of this assertion.issueInstant- Time instant of the issue. It has typedateTimewhich is built in to the W3C XML Schema Types specification. if null, current time is used.conditions-Conditionsunder which the thisAssertionis valid.advice-Adviceapplicable for thisAssertion.subject-Subjectapplicable for thisAssertionstatements- List ofStatementobjects within thisAssertion. It could be of typeAuthnStatement,AuthzDecisionStatementandAttributeStatement. Each Assertion can have multiple type of statements in it.- Throws:
SAMLException- if there is an error in processing input.
-
createAssertion
public abstract Assertion createAssertion(String ID, NameID issuer, GregorianCalendar issueInstant, Conditions conditions, Advice advice, Subject subject, List statements, jakarta.xml.bind.JAXBContext jcc) throws SAMLException Creates and return an Assertion from the data members: theID, the issuer, time when assertion issued, the conditions when creating a new assertion ,Adviceapplicable to thisAssertion,Subject, a set ofStatement(s) ,and a jaxbcontext for the assertion.- Parameters:
ID-IDobject contained within thisAssertionif null its generated internally.issuer- The issuer of this assertion.issueInstant- Time instant of the issue. It has typedateTimewhich is built in to the W3C XML Schema Types specification. if null, current time is used.conditions-Conditionsunder which the thisAssertionis valid.advice-Adviceapplicable for thisAssertion.subject-Subjectapplicable for thisAssertionstatements- List ofStatementobjects within thisAssertion. It could be of typeAuthnStatement,AuthzDecisionStatementandAttributeStatement. Each Assertion can have multiple type of statements in it.jcc- JAXBContext to be used for marshaling and unmarshalling the assertions.- Throws:
SAMLException- if there is an error in processing input.
-
createAssertion
Creates and returns anAssertionobject from the given SAMLorg.w3c.dom.Element.- Parameters:
element- Aorg.w3c.dom.Elementrepresenting DOM tree forAssertionobject- Throws:
SAMLException- if it could not process the Element properly, implying that there is an error in the sender or in the element definition.
-
createAssertion
Creates and returns anAssertionobject from the given SAMLXMLStreamReader.- Parameters:
reader- AnXMLStreamReaderrepresenting the tree for anAssertionobject- Throws:
SAMLException- if it could not process the Element properly, implying that there is an error in the sender or in the element definition.
-
createAssertionIDReference
Creates and returns anAssertionIDReferenceobject. AssertionID will be generated automatically.- Returns:
- null if the system property "com.sun.xml.wss.saml.binding.jaxb" is not set otherwise returns AssertionIDReference.
-
createAssertionIDRef
Creates and returns anAssertionIDRefobject. AssertionID will be generated automatically.- Returns:
- null if the system property "com.sun.xml.wss.saml.binding.jaxb" is not set otherwise returns AssertionIDReference.
-
createAssertionIDReference
Creates and returns anAssertionIDReferenceobject.- Parameters:
id-Stringof an AssertionID- Returns:
- null if the system property "com.sun.xml.wss.saml.binding.jaxb" is not set otherwise returns AssertionIDReference.
-
createAssertionIDRef
Creates and returns anAssertionIDRefobject.- Parameters:
id-Stringof an AssertionID- Returns:
- null if the system property "com.sun.xml.wss.saml.binding.jaxb" is not set otherwise returns AssertionIDReference.
-
createAttribute
Constructs an instance ofAttribute.- Parameters:
name- A String representingAttributeName(the name of the attribute).nameSpace- A String representing the namespace in whichAttributeNameelements are interpreted.values- A List representing theAttributeValueobject.
-
createAttribute
Constructs an instance ofAttribute.- Parameters:
name- A String representingAttributeName(the name of the attribute).values- A List representing theAttributeValueobject.
-
createAttributeDesignator
Constructs an instance ofAttributeDesignator.- Parameters:
name- the name of the attribute.nameSpace- the namespace in whichAttributeNameelements are interpreted.
-
createAttributeStatement
Constructs an instance ofAttributeStatement.- Parameters:
subj- SAML Subjectattr- List of attributes
-
createAttributeStatement
Constructs an instance ofAttributeStatement.- Parameters:
attr- List of attributes
-
createAudienceRestrictionCondition
Constructs an instance ofAudienceRestrictionCondition. It takes in aListof audience for this condition, each of them being a String.- Parameters:
audience- A List of audience to be included within this condition
-
createAudienceRestriction
Constructs an instance ofAudienceRestriction. It takes in aListof audience for this condition, each of them being a String.- Parameters:
audience- A List of audience to be included within this condition
-
createAuthenticationStatement
public abstract AuthenticationStatement createAuthenticationStatement(String authMethod, GregorianCalendar authInstant, Subject subject, SubjectLocality subjectLocality, List authorityBinding) Constructs an instance ofAuthenticationStatement.- Parameters:
authMethod- (optional) A String specifies the type of authentication that took place. Pass null if not required.authInstant- (optional) A GregorianCalendar object specifing the time at which the authentication that took place. Pass null if not required.subject- (required) A Subject objectsubjectLocality- (optional) ASubjectLocalityobject. Pass null if not required.authorityBinding- (optional) A List ofAuthorityBinding. Pass null if not required. objects.
-
createAuthnStatement
public abstract AuthnStatement createAuthnStatement(GregorianCalendar authInstant, SubjectLocality subjectLocality, AuthnContext authnContext, String sessionIndex, GregorianCalendar sessionNotOnOrAfter) Constructs an instance ofAuthenticationStatement.- Parameters:
authInstant- (optional) A GregorianCalendar object specifing the time at which the authentication that took place. Pass null if not required.subjectLocality- (optional) ASubjectLocalityobject. Pass null if not required.authnContext- (optional) AAuthnContextobject. Pass null if not required. objects.
-
createAuthorityBinding
public abstract AuthorityBinding createAuthorityBinding(QName authKind, String location, String binding) Constructs an instance ofAuthorityBinding.- Parameters:
authKind- A QName representing the type of SAML protocol queries to which the authority described by this element will respond.location- A String representing a URI reference describing how to locate and communicate with the authority.binding- A String representing a URI reference identifying the SAML protocol binding to use in communicating with the authority.
-
createAuthnContext
-
createAuthnContext
public abstract AuthnContext createAuthnContext(String authContextClassref, String authenticatingAuthority) -
createAuthorizationDecisionStatement
public abstract AuthorizationDecisionStatement createAuthorizationDecisionStatement(Subject subject, String resource, String decision, List action, Evidence evidence) Constructs an instance ofAuthorizationDecisionStatement.- Parameters:
subject- (required) A Subject objectresource- (required) A String identifying the resource to which access authorization is sought.decision- (required) The decision rendered by the issuer with respect to the specified resource.action- (required) A List of Action objects specifying the set of actions authorized to be performed on the specified resource.evidence- (optional) An Evidence object representing a set of assertions that the issuer replied on in making decisions.
-
createAuthnDecisionStatement
public abstract AuthnDecisionStatement createAuthnDecisionStatement(String resource, String decision, List action, Evidence evidence) Constructs an instance ofAuthnDecisionStatement.- Parameters:
resource- (required) A String identifying the resource to which access authorization is sought.decision- (required) The decision rendered by the issuer with respect to the specified resource.action- (required) A List of Action objects specifying the set of actions authorized to be performed on the specified resource.evidence- (optional) AnEvidenceobject representing a set of assertions that the issuer replied on in making decisions.
-
createConditions
Constructs an instance of defaultConditionsobject. -
createConditions
public abstract Conditions createConditions(GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, List condition, List arc, List doNotCacheCnd) Constructs an instance ofConditions.- Parameters:
notBefore- specifies the earliest time instant at which the assertion is valid.notOnOrAfter- specifies the time instant at which the assertion has expired.arc- theAudienceRestrictionConditionto be added. Can be null, if no audience restriction.
-
createConditions
public abstract Conditions createConditions(GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, List condition, List ar, List oneTimeUse, List proxyRestriction) Constructs an instance ofConditions.- Parameters:
notBefore- specifies the earliest time instant at which the assertion is valid.notOnOrAfter- specifies the time instant at which the assertion has expired.ar- theAudienceRestrictionto be added. Can be null, if no audience restriction.
-
createDoNotCacheCondition
Constructs an instance ofDoNotCacheCondition -
createOneTimeUse
-
createEvidence
Constructs an Evidence from a List ofAssertionandAssertionIDReferenceobjects.- Parameters:
assertionIDRef- List ofAssertionIDReferenceobjects.assertion- List ofAssertionobjects.
-
createNameIdentifier
public abstract NameIdentifier createNameIdentifier(String name, String nameQualifier, String format) Constructs aNameQualifierinstance.- Parameters:
name- The string representing the name of the SubjectnameQualifier- The security or administrative domain that qualifies the name of theSubject. This is optional could be null.format- The syntax used to describe the name of theSubject. This optional, could be null.
-
createNameID
Constructs aNameIDinstance.- Parameters:
name- The string representing the name of the SubjectnameQualifier- The security or administrative domain that qualifies the name of theSubject. This is optional could be null.format- The syntax used to describe the name of theSubject. This optional, could be null.
-
createSubject
public abstract Subject createSubject(NameIdentifier nameIdentifier, SubjectConfirmation subjectConfirmation) Constructs a Subject object from aNameIdentifierobject and aSubjectConfirmationobject.- Parameters:
nameIdentifier-NameIdentifierobject.subjectConfirmation-SubjectConfirmationobject.
-
createSubject
Constructs a Subject object from aNameIDobject and aSubjectConfirmationobject.- Parameters:
nameID-NameIDobject.subjectConfirmation-SubjectConfirmationobject.
-
createSubjectConfirmation
Creates and returns aSubjectConfirmationobject.- Parameters:
confirmationMethod- A URI (String) that identifies a protocol used to authenticate aSubject. Please refer todraft-sstc-core-25Section 7 for a list of URIs identifying common authentication protocols.
-
createSubjectConfirmation
Creates and returns aSubjectConfirmationobject.- Parameters:
nameID-NameIDobject.method- A URI (String) that identifies a protocol used to authenticate aSubject. Please refer todraft-sstc-core-25Section 7 for a list of URIs identifying common authentication protocols.
-
createSubjectConfirmation
public abstract SubjectConfirmation createSubjectConfirmation(List confirmationMethods, SubjectConfirmationData scd, KeyInfo keyInfo) throws SAMLException - Throws:
SAMLException
-
createSubjectConfirmation
public abstract SubjectConfirmation createSubjectConfirmation(List confirmationMethods, Element subjectConfirmationData, Element keyInfo) throws SAMLException Constructs aSubjectConfirmationinstance.- Parameters:
confirmationMethods- A list ofconfirmationMethodseach of which is a URI (String) that identifies a protocol used to authenticate aSubject. Please refer todraft-sstc-core-25Section 7 for a list of URIs identifying common authentication protocols.subjectConfirmationData- Additional authentication information to be used by a specific authentication protocol. Can be passed as null if there is nosubjectConfirmationDatafor theSubjectConfirmationobject.keyInfo- An XML signature element that specifies a cryptographic key held by theSubject.- Throws:
SAMLException
-
createSubjectConfirmation
public abstract SubjectConfirmation createSubjectConfirmation(NameID nameID, SubjectConfirmationData subjectConfirmationData, String confirmationMethods) throws SAMLException Constructs aSubjectConfirmationinstance.- Parameters:
nameID-NameIDobject.subjectConfirmationData- Additional authentication information to be used by a specific authentication protocol. Can be passed as null if there is nosubjectConfirmationDatafor theSubjectConfirmationobject.confirmationMethods- A list ofconfirmationMethodseach of which is a URI (String) that identifies a protocol used to authenticate aSubject. Please refer todraft-sstc-core-25Section 7 for a list of URIs identifying common authentication protocols.- Throws:
SAMLException
-
createSubjectConfirmation
public abstract SubjectConfirmation createSubjectConfirmation(NameID nameID, KeyInfoConfirmationData keyInfoConfirmationData, String confirmationMethods) throws SAMLException Constructs aSubjectConfirmationinstance.- Parameters:
nameID-NameIDobject.keyInfoConfirmationData- Additional authentication information to be used by a specific authentication protocol. Can be passed as null if there is noKeyInfoConfirmationDatafor theSubjectConfirmationobject.confirmationMethods- A list ofconfirmationMethodseach of which is a URI (String) that identifies a protocol used to authenticate aSubject. Please refer todraft-sstc-core-25Section 7 for a list of URIs identifying common authentication protocols.- Throws:
SAMLException
-
createSubjectConfirmationData
public abstract SubjectConfirmationData createSubjectConfirmationData(String address, String inResponseTo, GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, String recipient, Element keyInfo) throws SAMLException - Throws:
SAMLException
-
createSubjectConfirmationData
public abstract SubjectConfirmationData createSubjectConfirmationData(String address, String inResponseTo, GregorianCalendar notBefore, GregorianCalendar notOnOrAfter, String recipient, KeyInfo keyInfo) -
createKeyInfoConfirmationData
public abstract KeyInfoConfirmationData createKeyInfoConfirmationData(Element keyInfo) throws SAMLException - Throws:
SAMLException
-
createSubjectLocality
Constructs aSubjectLocalityinstance. -
createSubjectLocality
Constructs an instance ofSubjectLocality.- Parameters:
ipAddress- String representing the IP Address of the entity that was authenticated.dnsAddress- String representing the DNS Address of the entity that was authenticated. As per SAML specification they are both optional, so values can be null.
-