Class SAMLAssertionFactory
- java.lang.Object
-
- org.keycloak.saml.processing.core.saml.v2.factories.SAMLAssertionFactory
-
public class SAMLAssertionFactory extends Object
Deal withAssertionType
- Since:
- Jan 28, 2009
- Author:
- Anil.Saldhana@redhat.com
-
-
Constructor Summary
Constructors Constructor Description SAMLAssertionFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AssertionType
createAssertion(String id, NameIDType issuerID, XMLGregorianCalendar issueInstant, ConditionsType conditions, SubjectType subject, List<StatementAbstractType> statements)
Creates a SAMLV2AssertionType
with the specified values.static AudienceRestrictionType
createAudienceRestriction(String... values)
Creates anAudienceRestrictionType
with the specified values.static ConditionsType
createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions)
Creates aConditions
instance with the specified values.static KeyInfoConfirmationDataType
createKeyInfoConfirmation(KeyInfoType keyInfo)
Creates aKeyInfoConfirmationDataType
with the specifiedKeyInfoType
.static NameIDType
createNameID(String format, String qualifier, String value)
Creates aNameIDType
instance with the specified values.static SubjectType
createSubject(NameIDType nameID, SubjectConfirmationType confirmation)
Creates aSubjectType
object with the specified values.static SubjectConfirmationType
createSubjectConfirmation(NameIDType nameID, String confirmationMethod, KeyInfoConfirmationDataType keyInfoData)
Creates aSubjectConfirmationType
object with the specified values.
-
-
-
Method Detail
-
createAudienceRestriction
public static AudienceRestrictionType createAudienceRestriction(String... values)
Creates an
AudienceRestrictionType
with the specified values.- Parameters:
values
- aString[]
containing the restriction values.- Returns:
- the constructed
AudienceRestrictionType
instance.
-
createNameID
public static NameIDType createNameID(String format, String qualifier, String value)
Creates a
NameIDType
instance with the specified values.- Parameters:
format
- aString
representing the name format.qualifier
- aString
representing the name qualifier.value
- aString
representing the name value.- Returns:
- the constructed
NameIDType
instance.
-
createConditions
public static ConditionsType createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions)
Creates a
Conditions
instance with the specified values.- Parameters:
notBefore
- aXMLGregorianCalendar
representing the start of the token lifetime period.notOnOrAfter
- aXMLGregorianCalendar
representing the end of the token lifetime period.restrictions
- an array containing the applicable restrictions.- Returns:
- the constructed
Conditions
instance.
-
createKeyInfoConfirmation
public static KeyInfoConfirmationDataType createKeyInfoConfirmation(KeyInfoType keyInfo)
Creates a
KeyInfoConfirmationDataType
with the specifiedKeyInfoType
.- Parameters:
keyInfo
- theKeyInfoType
object that wraps the proof-of-possession token.- Returns:
- the constructed
KeyInfoConfirmationDataType
instance.
-
createSubjectConfirmation
public static SubjectConfirmationType createSubjectConfirmation(NameIDType nameID, String confirmationMethod, KeyInfoConfirmationDataType keyInfoData)
Creates a
SubjectConfirmationType
object with the specified values.- Parameters:
nameID
- the identifier of the confirmation.confirmationMethod
- aString
representing the confirmation method.keyInfoData
- theKeyInfoConfirmationDataType
instance that contains the proof of possession key.- Returns:
- the constructed
SubjectConfirmationType
instance.
-
createSubject
public static SubjectType createSubject(NameIDType nameID, SubjectConfirmationType confirmation)
Creates a
SubjectType
object with the specified values.- Parameters:
nameID
- the identifier of the subject.confirmation
- theSubjectConfirmationType
that is used to establish the correspondence between the subject and claims of SAML statements.- Returns:
- the constructed
SubjectType
instance.
-
createAssertion
public static AssertionType createAssertion(String id, NameIDType issuerID, XMLGregorianCalendar issueInstant, ConditionsType conditions, SubjectType subject, List<StatementAbstractType> statements)
Creates a SAMLV2
AssertionType
with the specified values.- Parameters:
id
- aString
representing the assertion ID.issuerID
- aNameIDType
that identifies the assertion issuer.issueInstant
- the assertion time of creation.conditions
- theConditionsType
that specify the conditions under which the assertion is to be considered validsubject
- theSubjectType
that identifies the authenticated principal.statements
- a list of statements associated with the authenticated principal.- Returns:
-
-