Skip to content

Instantly share code, notes, and snippets.

@mburrows02
Created March 1, 2016 19:04
Show Gist options
  • Save mburrows02/1fef76355d66cdfad619 to your computer and use it in GitHub Desktop.
Save mburrows02/1fef76355d66cdfad619 to your computer and use it in GitHub Desktop.
NameIDBuilder nameIDBuilder = new NameIDBuilder();
NameID nameID = nameIDBuilder.buildObject();
nameID.setSPNameQualifier(spEntityId);
nameID.setValue(pai);
nameID.setFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:persistent");
if (encryptionService != null) {
EncryptedID encryptedNameID = encryptionService.encryptNameID(nameID);
logoutRequest.setEncryptedID(encryptedNameID);
} else {
logoutRequest.setNameID(nameID);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment