Skip to content

Commit

Permalink
feat(jans-auth): Show valid client name or id in consent form (#10649)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuriy Movchan <[email protected]>
  • Loading branch information
yurem authored Jan 16, 2025
1 parent 2381a09 commit 5a53d53
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def destroy(self, configurationAttributes):
return True

def getApiVersion(self):
return 1
return 11

# Main consent-gather method. Must return True (if gathering performed successfully) or False (if fail).
# All user entered values can be access via Map<String, String> context.getPageAttributes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,20 @@ public String getClientDisplayName() {
}

final Client client = clientService.getClient(clientId);
return getCheckedClientDisplayName(client);
}

public String getClientDisplayName(final Client client) {
log.trace("client {}", client);

if (client == null) {
getClientDisplayName();
}

return getCheckedClientDisplayName(client);
}

private String getCheckedClientDisplayName(final Client client) {
if (StringUtils.isNotBlank(client.getClientName())) {
return client.getClientName();
}
Expand All @@ -998,7 +1012,7 @@ public String getClientDisplayName() {
}

return "Unknown";
}
}

public String getAuthReqId() {
return authReqId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<h:outputFormat
value="#{msgs['authorize.requestingPermissionForScopes']}">
<f:param
value="#{authorizeAction.clientDisplayName}" />
value="#{authorizeAction.getClientDisplayName(client)}" />
</h:outputFormat>
</p>
</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def destroy(self, configurationAttributes):
return True

def getApiVersion(self):
return 1
return 11

# Main consent-gather method. Must return True (if gathering performed successfully) or False (if fail).
# All user entered values can be access via Map<String, String> context.getPageAttributes()
Expand Down

0 comments on commit 5a53d53

Please sign in to comment.