From e8cf1dd92fa952ac94a0dfee80e58f70a0a1b69c Mon Sep 17 00:00:00 2001 From: Luca Leonardo Scorcia Date: Mon, 16 Nov 2020 05:16:21 -0500 Subject: [PATCH] KEYCLOAK-16325 Forgot the NameQualifier property in SAML2NameIDBuilder --- .../main/java/org/keycloak/saml/SAML2NameIDBuilder.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/saml-core/src/main/java/org/keycloak/saml/SAML2NameIDBuilder.java b/saml-core/src/main/java/org/keycloak/saml/SAML2NameIDBuilder.java index 1fd60423e2..d3104e89c3 100644 --- a/saml-core/src/main/java/org/keycloak/saml/SAML2NameIDBuilder.java +++ b/saml-core/src/main/java/org/keycloak/saml/SAML2NameIDBuilder.java @@ -23,6 +23,7 @@ import java.net.URI; public class SAML2NameIDBuilder { private final NameIDType nameIdType; private String format; + private String nameQualifier; private String spNameQualifier; private SAML2NameIDBuilder(String value) { @@ -39,6 +40,11 @@ public class SAML2NameIDBuilder { return this; } + public SAML2NameIDBuilder setNameQualifier(String nameQualifier) { + this.nameQualifier = nameQualifier; + return this; + } + public SAML2NameIDBuilder setSPNameQualifier(String spNameQualifier) { this.spNameQualifier = spNameQualifier; return this; @@ -48,6 +54,9 @@ public class SAML2NameIDBuilder { if (this.format != null) this.nameIdType.setFormat(URI.create(this.format)); + if (this.nameQualifier != null) + this.nameIdType.setNameQualifier(this.nameQualifier); + if (this.spNameQualifier != null) this.nameIdType.setSPNameQualifier(this.spNameQualifier);