From b58339a4efe0faeb1ea910a5e8cec6174c79343b Mon Sep 17 00:00:00 2001 From: YuriyZ Date: Wed, 23 Nov 2022 14:03:37 +0200 Subject: [PATCH] fix:(jans-auth-server): fixed Client serialization/deserialization bug #2946 --- .../as/common/model/registration/Client.java | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/jans-auth-server/common/src/main/java/io/jans/as/common/model/registration/Client.java b/jans-auth-server/common/src/main/java/io/jans/as/common/model/registration/Client.java index 56b1b8cab81..8b635c92e68 100644 --- a/jans-auth-server/common/src/main/java/io/jans/as/common/model/registration/Client.java +++ b/jans-auth-server/common/src/main/java/io/jans/as/common/model/registration/Client.java @@ -6,6 +6,7 @@ package io.jans.as.common.model.registration; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import io.jans.as.model.common.*; @@ -600,6 +601,7 @@ public void setIdTokenTokenBindingCnf(String idTokenTokenBindingCnf) { this.idTokenTokenBindingCnf = idTokenTokenBindingCnf; } + @JsonIgnore public boolean isTokenBindingSupported() { return StringUtils.isNotBlank(idTokenTokenBindingCnf); } @@ -707,11 +709,32 @@ public LocalizedString getClientNameLocalized() { return clientNameLocalized; } + public void setClientNameLocalized(LocalizedString clientNameLocalized) { + this.clientNameLocalized = clientNameLocalized; + } + + public void setLogoUriLocalized(LocalizedString logoUriLocalized) { + this.logoUriLocalized = logoUriLocalized; + } + + public void setClientUriLocalized(LocalizedString clientUriLocalized) { + this.clientUriLocalized = clientUriLocalized; + } + + public void setPolicyUriLocalized(LocalizedString policyUriLocalized) { + this.policyUriLocalized = policyUriLocalized; + } + + public void setTosUriLocalized(LocalizedString tosUriLocalized) { + this.tosUriLocalized = tosUriLocalized; + } + /** * Sets the name of the Client to be presented to the user. * * @param clientName The name of the Client to be presented to the user. */ + @JsonIgnore public void setClientNameLocalized(String clientName) { this.clientName = clientName; this.clientNameLocalized.setValue(clientName); @@ -723,6 +746,7 @@ public void setClientNameLocalized(String clientName) { * @param clientName The name of the Client to be presented to the user. * @param locale The locale */ + @JsonIgnore public void setClientNameLocalized(String clientName, Locale locale) { if (StringUtils.isNotBlank(locale.toString())) { this.clientNameLocalized.setValue(clientName, locale); @@ -745,6 +769,7 @@ public LocalizedString getLogoUriLocalized() { * * @param logoUri The URL of a logo image for the Client where it can be retrieved. */ + @JsonIgnore public void setLogoUriLocalized(String logoUri) { this.logoUri = logoUri; this.logoUriLocalized.setValue(logoUri); @@ -756,6 +781,7 @@ public void setLogoUriLocalized(String logoUri) { * @param logoUri The URL of a logo image for the Client where it can be retrieved. * @param locale The locale */ + @JsonIgnore public void setLogoUriLocalized(String logoUri, Locale locale) { if (StringUtils.isNotBlank(locale.toString())) { this.logoUriLocalized.setValue(logoUri, locale); @@ -778,6 +804,7 @@ public LocalizedString getClientUriLocalized() { * * @param clientUri The URL of the home page of the Client. */ + @JsonIgnore public void setClientUriLocalized(String clientUri) { this.clientUri = clientUri; this.clientUriLocalized.setValue(clientUri); @@ -789,6 +816,7 @@ public void setClientUriLocalized(String clientUri) { * @param clientUri The URL of the home page of the Client. * @param locale The locale */ + @JsonIgnore public void setClientUriLocalized(String clientUri, Locale locale) { if (StringUtils.isNotBlank(locale.toString())) { this.clientUriLocalized.setValue(clientUri, locale); @@ -813,6 +841,7 @@ public LocalizedString getPolicyUriLocalized() { * * @param policyUri A URL location about how the profile data will be used. */ + @JsonIgnore public void setPolicyUriLocalized(String policyUri) { this.policyUri = policyUri; this.policyUriLocalized.setValue(policyUri); @@ -825,6 +854,7 @@ public void setPolicyUriLocalized(String policyUri) { * @param policyUri A URL location about how the profile data will be used. * @param locale The locale */ + @JsonIgnore public void setPolicyUriLocalized(String policyUri, Locale locale) { if (StringUtils.isNotBlank(locale.toString())) { this.policyUriLocalized.setValue(policyUri, locale); @@ -849,6 +879,7 @@ public LocalizedString getTosUriLocalized() { * * @param tosUri The terms of service URL. */ + @JsonIgnore public void setTosUriLocalized(String tosUri) { this.tosUri = tosUri; this.tosUriLocalized.setValue(tosUri); @@ -861,6 +892,7 @@ public void setTosUriLocalized(String tosUri) { * @param tosUri The terms of service URL. * @param locale The Locale */ + @JsonIgnore public void setTosUriLocalized(String tosUri, Locale locale) { if (StringUtils.isNotBlank(locale.toString())) { this.tosUriLocalized.setValue(tosUri, locale); @@ -1421,14 +1453,6 @@ public void setBackchannelUserCodeParameter(Boolean backchannelUserCodeParameter this.backchannelUserCodeParameter = backchannelUserCodeParameter; } - public String getDisplayName() { - return getClientName(); - } - - public void setDisplayName(String displayName) { - setClientName(displayName); - } - public String getDescription() { return description; }