Skip to content

Commit

Permalink
Merge pull request wso2#4338 from Thisara-Welmilla/remove-redendant-u…
Browse files Browse the repository at this point in the history
…rl-validation

Remove redundant callback URL validation
  • Loading branch information
Thisara-Welmilla authored Oct 26, 2023
2 parents f96c11b + 238ac3e commit ad1e64e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-moles-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/identity-apps-core": patch
---

Remove redundant callback URL validation.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="org.apache.commons.text.StringEscapeUtils" %>
<%@ page import="org.owasp.encoder.Encode" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.client.CallBackValidator" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.client.IdentityRecoveryException" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.IdentityManagementEndpointUtil" %>
<%@ page import="java.io.File" %>
Expand All @@ -39,27 +38,6 @@
<%
String callback = (String) request.getAttribute("callback");
String username = request.getParameter("username");
CallBackValidator callBackValidator = new CallBackValidator();
try {
if (!callBackValidator.isValidCallbackURL(callback, tenantDomain)) {
request.setAttribute("error", true);
request.setAttribute("errorMsg", "Configured callback URL does not match with the provided callback " +
"URL in the request.");
if (!StringUtils.isBlank(username)) {
request.setAttribute("username", username);
}
request.getRequestDispatcher("error.jsp").forward(request, response);
return;
}
} catch (IdentityRecoveryException e) {
request.setAttribute("error", true);
request.setAttribute("errorMsg", "Callback URL validation failed. " + e.getMessage());
if (!StringUtils.isBlank(username)) {
request.setAttribute("username", username);
}
request.getRequestDispatcher("error.jsp").forward(request, response);
return;
}
%>

<%-- Data for the layout from the page --%>
Expand Down

0 comments on commit ad1e64e

Please sign in to comment.