Skip to content

Commit

Permalink
correctly encode embedded entityID in cas/login?service=...
Browse files Browse the repository at this point in the history
It was correctly encoded in serviceValidate, but not in login.

Without this change, entityID "http://foo/?a=b&c=d" does not work (since "&c=d" is lost)
  • Loading branch information
prigaux committed Jun 9, 2024
1 parent 35db65c commit 0dd5c9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected String constructServiceUrl(final HttpServletRequest request, final Htt
serviceParameterName, artifactParameterName, true);

if ("embed".equalsIgnoreCase(entityIdLocation)) {
serviceUrl += (new EntityIdParameterBuilder().getParameterString(request, false));
serviceUrl += (new EntityIdParameterBuilder().getParameterString(request, true));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public void testStartLoginRequestEmbeddedEntityId() throws Exception {
shibcasAuthServlet.init(createMockServletConfig("embed"));

shibcasAuthServlet.startLoginRequest(request, response, false, false, "");
verify(response).sendRedirect("https://cassserver.example.edu/cas/login?service=https%3A%2F%2Fshibserver.example.edu%2Fidp%2FAuthn%2FExtCas%3Fconversation%3De1s1%26entityId%3Dhttp%3A%2F%2Ftest.edu%2Fsp");
verify(response).sendRedirect("https://cassserver.example.edu/cas/login?service=https%3A%2F%2Fshibserver.example.edu%2Fidp%2FAuthn%2FExtCas%3Fconversation%3De1s1%26entityId%3Dhttp%253A%252F%252Ftest.edu%252Fsp");
}

@Test
Expand Down

0 comments on commit 0dd5c9d

Please sign in to comment.