Search in sources :

Example 1 with ConfirmationMethod

use of org.opensaml.saml.saml1.core.ConfirmationMethod in project cas by apereo.

the class Saml10ObjectBuilder method newSubject.

/**
     * New subject element with given confirmation method.
     *
     * @param identifier the identifier
     * @param confirmationMethod the confirmation method
     * @return the subject
     */
public Subject newSubject(final String identifier, final String confirmationMethod) {
    final SubjectConfirmation confirmation = newSamlObject(SubjectConfirmation.class);
    final ConfirmationMethod method = newSamlObject(ConfirmationMethod.class);
    method.setConfirmationMethod(confirmationMethod);
    confirmation.getConfirmationMethods().add(method);
    final NameIdentifier nameIdentifier = newSamlObject(NameIdentifier.class);
    nameIdentifier.setNameIdentifier(identifier);
    final Subject subject = newSamlObject(Subject.class);
    subject.setNameIdentifier(nameIdentifier);
    subject.setSubjectConfirmation(confirmation);
    return subject;
}
Also used : SubjectConfirmation(org.opensaml.saml.saml1.core.SubjectConfirmation) NameIdentifier(org.opensaml.saml.saml1.core.NameIdentifier) ConfirmationMethod(org.opensaml.saml.saml1.core.ConfirmationMethod) Subject(org.opensaml.saml.saml1.core.Subject)

Aggregations

ConfirmationMethod (org.opensaml.saml.saml1.core.ConfirmationMethod)1 NameIdentifier (org.opensaml.saml.saml1.core.NameIdentifier)1 Subject (org.opensaml.saml.saml1.core.Subject)1 SubjectConfirmation (org.opensaml.saml.saml1.core.SubjectConfirmation)1