Skip to content

Commit

Permalink
Merge pull request #3244 from gbarbon/feature-improvingSsoLog
Browse files Browse the repository at this point in the history
Improved logged parameters in SsoCallbackServlet request
  • Loading branch information
Coduz authored Feb 17, 2021
2 parents ab1935a + 50cd5c5 commit fa22688
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class SsoCallbackServlet extends HttpServlet {
private static final Logger logger = LoggerFactory.getLogger(SsoCallbackServlet.class);

// OpenID Connect single sign-on parameters
private static final String OPENID_CODE_PARAM = "code";
private static final String OPENID_STATE_PARAM = "state";
private static final String OPENID_SESSION_STATE_PARAM = "session_state";
private static final String OPENID_ACCESS_TOKEN_PARAM = "access_token";
private static final String OPENID_ID_TOKEN_PARAM = "id_token";
private static final String OPENID_ERROR_PARAM = "error";
Expand All @@ -55,7 +58,7 @@ public void init(ServletConfig config) throws ServletException {

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
final String authCode = req.getParameter("code");
final String authCode = req.getParameter(OPENID_CODE_PARAM);

String homeUri = "";
ConfigurationPrinter httpReqLogger =
Expand All @@ -66,7 +69,9 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
.withTitle("SSO Servlet Log")
.openSection("SSO servlet request")
.addParameter("Request URL", req.getRequestURL())
.addParameter("AuthCode", HIDDEN_SECRET)
.addParameter(OPENID_CODE_PARAM, HIDDEN_SECRET)
.addParameter(OPENID_STATE_PARAM, req.getParameter(OPENID_STATE_PARAM))
.addParameter(OPENID_SESSION_STATE_PARAM, req.getParameter(OPENID_SESSION_STATE_PARAM))
.closeSection();
try {
homeUri = SsoHelper.getHomeUri();
Expand Down

0 comments on commit fa22688

Please sign in to comment.