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;
}
Aggregations