Skip to content

Commit

Permalink
Merge pull request #10 from karelmaxa/fix-saml-nameid
Browse files Browse the repository at this point in the history
Remove SAML NameID override
  • Loading branch information
pavelhoral authored Oct 2, 2024
2 parents 5b16772 + 06992c4 commit 8d86f48
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
* Portions Copyright 2024 Wren Security.
*/
package org.forgerock.openig.handler.saml;

Expand Down Expand Up @@ -318,19 +319,12 @@ private static Response serviceSPInitiatedSSO(Request request,
}
String idpEntityID = form.getFirst(SAML2Constants.IDPENTITYID);
Map<String, List<String>> paramsMap = SAML2Utils.getParamsMap(servletRequest);
List<String> list = new ArrayList<>();
list.add(SAML2Constants.NAMEID_TRANSIENT_FORMAT);

// next line testing to see if we can change the name format
paramsMap.put(SAML2Constants.NAMEID_POLICY_FORMAT, list);

// TODO: add option to specify artifact
if (paramsMap.get(SAML2Constants.BINDING) == null) {
// use POST binding
list = new ArrayList<>();
list.add(SAML2Constants.HTTP_POST);
paramsMap.put(SAML2Constants.BINDING, list);
// Use POST binding as default value
paramsMap.put(SAML2Constants.BINDING, List.of(SAML2Constants.HTTP_POST));
}

if (idpEntityID == null || idpEntityID.length() == 0) {
SAML2MetaManager manager = new SAML2MetaManager();
List<String> idpEntities = manager.getAllRemoteIdentityProviderEntities(DEFAULT_REALM);
Expand Down

0 comments on commit 8d86f48

Please sign in to comment.