Expected Behavior I intend to add a request parameter when initiating login on the Service Provider (SP) and process it after receiving the Identity Provider (IdP) response.
Current Behavior My application currently utilizes the approach described in this Stack Overflow topic: [Stack Overflow Link]. I have this endpoint in my application:
@GetMapping("/saml/{companySlug}/course/{courseCode}")
public String courseRedirect(@PathVariable("companySlug") String companySlug, @PathVariable("courseCode") String courseCode) {
Company company = companyRepository.findSAMLBySlug(companySlug).orElseThrow(NotFoundException::new);
return String.format("redirect:/saml/login?idp=%s&urlAfterLogin=%s/sso?courseCode=%s", company.getIdpUrl(), "http://localhost:8080/", courseCode);
}
and a SAMLEntryPoint extension with request.getParameter("urlAfterLogin"). However, when attempting to recreate the same behavior with with a new implementation of AuthenticationEntryPoint, even with additions to WebSecurityConfigurerAdapter, it was not successful. This includes the following code snippet:
http
.exceptionHandling(exception -> exception
.authenticationEntryPoint(entryPoint()))
How can I recreate this behavior?
Comment From: jzheaux
Thanks for getting in touch, @mariasantosdev! It feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add more detail if you feel this is a genuine bug.
Comment From: mariasantosdev
Hi @jzheaux , Thanks. I've posted this question on Stack overflow under the spring-security tag : https://stackoverflow.com/questions/77955257/add-request-parameter-to-saml-request-using-spring-security-saml-2