use of org.opensaml.saml.saml2.core.impl.NameIDBuilder in project cloudstack by apache.
the class SAMLUtils method buildLogoutRequest.
public static LogoutRequest buildLogoutRequest(String logoutUrl, String spId, String nameIdString) {
Issuer issuer = new IssuerBuilder().buildObject();
issuer.setValue(spId);
NameID nameID = new NameIDBuilder().buildObject();
nameID.setValue(nameIdString);
LogoutRequest logoutRequest = new LogoutRequestBuilder().buildObject();
logoutRequest.setID(generateSecureRandomId());
logoutRequest.setDestination(logoutUrl);
logoutRequest.setVersion(SAMLVersion.VERSION_20);
logoutRequest.setIssueInstant(new DateTime());
logoutRequest.setIssuer(issuer);
logoutRequest.setNameID(nameID);
return logoutRequest;
}
use of org.opensaml.saml.saml2.core.impl.NameIDBuilder in project cxf by apache.
the class SamlpRequestComponentBuilder method createNameIDPolicy.
@SuppressWarnings("unchecked")
public static NameIDPolicy createNameIDPolicy(boolean allowCreate, String format, String spNameQualifier) {
if (nameIDBuilder == null) {
nameIDBuilder = (SAMLObjectBuilder<NameIDPolicy>) builderFactory.getBuilder(NameIDPolicy.DEFAULT_ELEMENT_NAME);
}
NameIDPolicy nameId = nameIDBuilder.buildObject();
nameId.setAllowCreate(allowCreate);
nameId.setFormat(format);
nameId.setSPNameQualifier(spNameQualifier);
return nameId;
}
Aggregations