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);