Skip to content
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

Improved logged parameters in SsoCallbackServlet request #3244

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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