diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java b/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java index 35384a724db..9433e274ce3 100644 --- a/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java +++ b/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java @@ -86,6 +86,7 @@ @Named public class AuthorizeAction { + public static final String UNKNOWN = "Unknown"; @Inject private Logger log; @@ -985,7 +986,7 @@ public String getClientDisplayName() { log.trace("client {}", clientId); if (StringUtils.isBlank(clientId)) { - return "Unknown"; + return UNKNOWN; } final Client client = clientService.getClient(clientId); @@ -994,15 +995,19 @@ public String getClientDisplayName() { public String getClientDisplayName(final Client client) { log.trace("client {}", client); - + if (client == null) { - getClientDisplayName(); + return UNKNOWN; } return getCheckedClientDisplayName(client); } private String getCheckedClientDisplayName(final Client client) { + if (client == null) { + return UNKNOWN; + } + if (StringUtils.isNotBlank(client.getClientName())) { return client.getClientName(); } @@ -1011,7 +1016,7 @@ private String getCheckedClientDisplayName(final Client client) { return client.getClientId(); } - return "Unknown"; + return UNKNOWN; } public String getAuthReqId() {