KEYCLOAK-16325 Forgot the NameQualifier property in SAML2NameIDBuilder

This commit is contained in:
Luca Leonardo Scorcia 2020-11-16 05:16:21 -05:00 committed by Hynek Mlnařík
parent 637773e265
commit e8cf1dd92f

View file

@ -23,6 +23,7 @@ import java.net.URI;
public class SAML2NameIDBuilder { public class SAML2NameIDBuilder {
private final NameIDType nameIdType; private final NameIDType nameIdType;
private String format; private String format;
private String nameQualifier;
private String spNameQualifier; private String spNameQualifier;
private SAML2NameIDBuilder(String value) { private SAML2NameIDBuilder(String value) {
@ -39,6 +40,11 @@ public class SAML2NameIDBuilder {
return this; return this;
} }
public SAML2NameIDBuilder setNameQualifier(String nameQualifier) {
this.nameQualifier = nameQualifier;
return this;
}
public SAML2NameIDBuilder setSPNameQualifier(String spNameQualifier) { public SAML2NameIDBuilder setSPNameQualifier(String spNameQualifier) {
this.spNameQualifier = spNameQualifier; this.spNameQualifier = spNameQualifier;
return this; return this;
@ -48,6 +54,9 @@ public class SAML2NameIDBuilder {
if (this.format != null) if (this.format != null)
this.nameIdType.setFormat(URI.create(this.format)); this.nameIdType.setFormat(URI.create(this.format));
if (this.nameQualifier != null)
this.nameIdType.setNameQualifier(this.nameQualifier);
if (this.spNameQualifier != null) if (this.spNameQualifier != null)
this.nameIdType.setSPNameQualifier(this.spNameQualifier); this.nameIdType.setSPNameQualifier(this.spNameQualifier);