-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display authorization details in authentication web application #7117
Open
VimukthiRajapaksha
wants to merge
3
commits into
wso2:master
Choose a base branch
from
VimukthiRajapaksha:master_rar
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<%-- | ||
~ | ||
~ Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. | ||
~ Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. | ||
~ | ||
~ This software is the property of WSO2 LLC. and its suppliers, if any. | ||
~ Dissemination of any information or reproduction of any material contained | ||
|
@@ -10,6 +10,7 @@ | |
--%> | ||
|
||
<%@ page import="org.apache.commons.collections.CollectionUtils" %> | ||
<%@ page import="org.apache.commons.collections.MapUtils" %> | ||
<%@ page import="org.apache.commons.lang.StringUtils" %> | ||
<%@ page import="org.owasp.encoder.Encode" %> | ||
<%@ page import="org.wso2.carbon.identity.application.authentication.endpoint.util.Constants" %> | ||
|
@@ -62,6 +63,20 @@ | |
} | ||
|
||
boolean displayScopes = Boolean.parseBoolean(getServletContext().getInitParameter("displayScopes")); | ||
|
||
final String authorizationDetailsParam = request.getParameter("authorization_details"); | ||
final Map<String, String> authorizationDetailsToBeDisplayed = new HashMap<>(); | ||
if (StringUtils.isNotBlank(authorizationDetailsParam)) { | ||
final JSONArray authorizationDetails = new JSONArray(authorizationDetailsParam); | ||
for (int index = 0; index < authorizationDetails.length(); index++) { | ||
JSONObject authorizationDetail = authorizationDetails.getJSONObject(index); | ||
|
||
// Check if consent description is not empty, otherwise use type. | ||
final String description = authorizationDetail.optString("_description", authorizationDetail.getString("type")); | ||
final String authorizationDetailId = "authorization_detail_id_" + authorizationDetail.getString("_id"); | ||
authorizationDetailsToBeDisplayed.put(authorizationDetailId, description); | ||
} | ||
} | ||
%> | ||
|
||
<%-- Data for the layout from the page --%> | ||
|
@@ -233,6 +248,45 @@ | |
} | ||
%> | ||
|
||
<% | ||
if (MapUtils.isNotEmpty(authorizationDetailsToBeDisplayed)) { | ||
%> | ||
<div style="text-align: left;"> | ||
<div class="claim-list ui list"> | ||
<div class="item mt-2"> | ||
<i aria-hidden="true" class="circle tiny icon primary consent-item-bullet" id="Authorization Details Types"></i> | ||
<div class="content mt-2"> | ||
<div class="header light-font"> | ||
<%=AuthenticationEndpointUtil.i18n(resourceBundle, "requested.authorization-details")%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use the i18n function defined in identity-apps-core/apps/authentication-portal/src/main/webapp/includes/localize.jsp instead. |
||
</div> | ||
</div> | ||
<div class="content light-font"> | ||
<div class="border-gray margin-bottom-double"> | ||
<div class="claim-list"> | ||
<% | ||
for (Map.Entry<String, String> authorizationDetailEntry : authorizationDetailsToBeDisplayed.entrySet()) { | ||
%> | ||
<div class="mt-1 pl-2"> | ||
<div class="ui checkbox" style="display: flex"> | ||
<input type="checkbox" class="hidden" name="<%=authorizationDetailEntry.getKey()%>" id="<%=authorizationDetailEntry.getKey()%>" /> | ||
<label id="<%=authorizationDetailEntry.getKey()%>" for="<%=authorizationDetailEntry.getKey()%>"> | ||
<%=Encode.forHtml(authorizationDetailEntry.getValue())%> | ||
</label> | ||
</div> | ||
</div> | ||
<% | ||
} | ||
%> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<% | ||
} | ||
%> | ||
|
||
<div class="ui divider hidden"></div> | ||
|
||
<div class="field mt-4 text-center login-portal-app-des-font"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow the convention for i18n keys.
Also update the other language properties files too.