Spring Boot Security Hell
Currently I am building some web app. The problem is that I have a login method dedicated for anyone to use:
As it can be seen I've directly told it to throw FAILED_DEPENDENCY (just as a test), because my security config:
always makes it return 403 when an exception occurred. No matter what exception is thrown, it answers with a 403 when using the endpoint "/api/v1/user/login". When no error is thrown it works, so I don't know what is going on...
13 Replies
⌛
This post has been reserved for your question.
Hey @Groldi! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
My guess is CSRF
Do you include CSRF tokens in the request?
.
I do not
Wait
this is my only filter, but the problem still occurres when bypassing it
Can you enable DEBUG or TRACE logging for Spring Security and show these logs when making the request?
Stack Overflow
How do I enable logging for Spring Security?
I am setting up Spring Security to handle logging users in. I have logged in as a user, and am taken to an Access Denied error page upon successful login. I don't know what roles my user has actually
Sure, will do when home, thanks for your time however.
What was there before?
How are you adding the filter?
I'll send you the whole log in 5 minutes, currently I needed to switch to another branch and demonstrate something
Security Config:
https://gist.github.com/Plugrol/4c53c6af719e4d011034769632566996
Okay, I've been looking at the logs and they tell me, that the request is forwared to the /error endpoint.
However, this endpoint is secured by .authentificated().
Therefore it fails with a 403. By enabling debug you lead me to the right choice. Thanks for your time!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@464005014696886284>.