Class SAMLAssertionFactory
java.lang.Object
org.keycloak.saml.processing.core.saml.v2.factories.SAMLAssertionFactory
Deal with
AssertionType- Since:
- Jan 28, 2009
- Author:
- Anil.Saldhana@redhat.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AssertionTypecreateAssertion(String id, NameIDType issuerID, XMLGregorianCalendar issueInstant, ConditionsType conditions, SubjectType subject, List<StatementAbstractType> statements) Creates a SAMLV2AssertionTypewith the specified values.static AudienceRestrictionTypecreateAudienceRestriction(String... values) Creates anAudienceRestrictionTypewith the specified values.static ConditionsTypecreateConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions) Creates aConditionsinstance with the specified values.static KeyInfoConfirmationDataTypecreateKeyInfoConfirmation(KeyInfoType keyInfo) Creates aKeyInfoConfirmationDataTypewith the specifiedKeyInfoType.static NameIDTypecreateNameID(String format, String qualifier, String value) Creates aNameIDTypeinstance with the specified values.static SubjectTypecreateSubject(NameIDType nameID, SubjectConfirmationType confirmation) Creates aSubjectTypeobject with the specified values.static SubjectConfirmationTypecreateSubjectConfirmation(NameIDType nameID, String confirmationMethod, KeyInfoConfirmationDataType keyInfoData) Creates aSubjectConfirmationTypeobject with the specified values.
-
Constructor Details
-
SAMLAssertionFactory
public SAMLAssertionFactory()
-
-
Method Details
-
createAudienceRestriction
Creates an
AudienceRestrictionTypewith the specified values.- Parameters:
values- aString[]containing the restriction values.- Returns:
- the constructed
AudienceRestrictionTypeinstance.
-
createNameID
Creates a
NameIDTypeinstance with the specified values.- Parameters:
format- aStringrepresenting the name format.qualifier- aStringrepresenting the name qualifier.value- aStringrepresenting the name value.- Returns:
- the constructed
NameIDTypeinstance.
-
createConditions
public static ConditionsType createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions) Creates a
Conditionsinstance with the specified values.- Parameters:
notBefore- aXMLGregorianCalendarrepresenting the start of the token lifetime period.notOnOrAfter- aXMLGregorianCalendarrepresenting the end of the token lifetime period.restrictions- an array containing the applicable restrictions.- Returns:
- the constructed
Conditionsinstance.
-
createKeyInfoConfirmation
Creates a
KeyInfoConfirmationDataTypewith the specifiedKeyInfoType.- Parameters:
keyInfo- theKeyInfoTypeobject that wraps the proof-of-possession token.- Returns:
- the constructed
KeyInfoConfirmationDataTypeinstance.
-
createSubjectConfirmation
public static SubjectConfirmationType createSubjectConfirmation(NameIDType nameID, String confirmationMethod, KeyInfoConfirmationDataType keyInfoData) Creates a
SubjectConfirmationTypeobject with the specified values.- Parameters:
nameID- the identifier of the confirmation.confirmationMethod- aStringrepresenting the confirmation method.keyInfoData- theKeyInfoConfirmationDataTypeinstance that contains the proof of possession key.- Returns:
- the constructed
SubjectConfirmationTypeinstance.
-
createSubject
Creates a
SubjectTypeobject with the specified values.- Parameters:
nameID- the identifier of the subject.confirmation- theSubjectConfirmationTypethat is used to establish the correspondence between the subject and claims of SAML statements.- Returns:
- the constructed
SubjectTypeinstance.
-
createAssertion
public static AssertionType createAssertion(String id, NameIDType issuerID, XMLGregorianCalendar issueInstant, ConditionsType conditions, SubjectType subject, List<StatementAbstractType> statements) Creates a SAMLV2
AssertionTypewith the specified values.- Parameters:
id- aStringrepresenting the assertion ID.issuerID- aNameIDTypethat identifies the assertion issuer.issueInstant- the assertion time of creation.conditions- theConditionsTypethat specify the conditions under which the assertion is to be considered validsubject- theSubjectTypethat identifies the authenticated principal.statements- a list of statements associated with the authenticated principal.- Returns:
-