Skip to content

Update requestRejectedHandler via setter #8985

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

Closed
wants to merge 1 commit into from

Conversation

Drezir
Copy link
Contributor

@Drezir Drezir commented Aug 27, 2020

Ability to set requestRejectedHandler via public settter in method WebSecurityConfigurerAdapter.configure(WebSecurity)

Ability to set requestRejectedHandler via public settter in method WebSecurityConfigurerAdapter.configure(WebSecurity)
@pivotal-issuemaster
Copy link

@Drezir Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@Drezir Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 27, 2020
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 29, 2020
@rwinch
Copy link
Member

rwinch commented Oct 26, 2020

Thanks for the PR @Drezir! For my understanding...Can you explain why you are wanting to provide a method on the DSL rather than picking up the RequestRejectedHandler as a Bean?

@rwinch rwinch added the status: waiting-for-feedback We need additional information before we can continue label Oct 26, 2020
@Drezir
Copy link
Contributor Author

Drezir commented Oct 27, 2020

I thought it should be there for consistency. I think that other WebMvcCinfigurerAdapter entities are also registrable using beans or methods.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Oct 27, 2020
@rwinch
Copy link
Member

rwinch commented Oct 27, 2020

Thanks for the explanation. Initially my thought was that there is only a need for one RequestRejectedHandler, but perhaps users are using a composite approach. Consistency is another good reason. Would you be able to add tests and fix the checkstyle/formatting error? To see it run ./gradlew :spring-security-web:check https://github.com/spring-projects/spring-security/pull/8985/checks?check_run_id=1037486294

@Drezir
Copy link
Contributor Author

Drezir commented Oct 27, 2020

Thanks for the explanation. Initially my thought was that there is only a need for one RequestRejectedHandler, but perhaps users are using a composite approach. Consistency is another good reason. Would you be able to add tests and fix the checkstyle/formatting error? To see it run ./gradlew :spring-security-web:check https://github.com/spring-projects/spring-security/pull/8985/checks?check_run_id=1037486294

Sure, I will try it.

@dawi
Copy link

dawi commented Sep 16, 2021

This would be a nice addition.
Then I would be able to configure different RequestRejectedHandlers for Webapp and Webservices.

  • For / I would redirect the user to an error page.
  • For /api I would render a meaningful json response.

Currently I have to implement one RequestRejectedHandler, which in our case is not nice,
because we have divided Webapp and Webservices into different modules.

@jzheaux
Copy link
Contributor

jzheaux commented Oct 1, 2021

@Drezir Are you able to apply the requested changes?

@rwinch rwinch removed their assignment Nov 16, 2021
@jgrandja jgrandja self-assigned this Nov 17, 2021
@jgrandja
Copy link
Contributor

Closing because the requested changes have not been made. Feel free to create a new PR with the requested changes.

@jgrandja jgrandja closed this Nov 17, 2021
@jgrandja jgrandja added status: declined A suggestion or change that we don't feel we should currently apply and removed status: feedback-provided Feedback has been provided labels Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants