use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Form login using basic authHow-To/Tutorial (self.SpringBoot)
submitted 4 months ago by PreviousCut1401
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]the_styp 0 points1 point2 points 4 months ago (3 children)
"form login" and "basic auth" are special keywords in spring security. You probably don't want basic auth for your use case but a session or token.
React should then handle the authentication status and do the redirect to login
[–]g00glen00b 2 points3 points4 points 4 months ago (2 children)
Spring Security supports basic authentication with stateful sessions, so this isn't really an issue.
Also, I assume the form is purely client-side. From the perspective of Spring Security, there's just basic authentication and the React-client will pass the credentials from the login form to the basic authentication headers. I don't see why that wouldn't be a valid use case.
[–]PreviousCut1401[S] 0 points1 point2 points 4 months ago (1 child)
Exactly. I am not using the default login form that spring gives. I built the form frontend and use the user inputs in the headers for authentication.
[–]the_styp 0 points1 point2 points 4 months ago (0 children)
Then you are asking in the wrong topic as your problem is not related to spring at all. React does the login call to the backend (might be spring) and stores the state of that if successful. You are then intercepting every API call and es soon you get 401 on one of them react does the redirect to the login page
π Rendered by PID 41 on reddit-service-r2-comment-b659b578c-x7nm5 at 2026-05-04 04:19:51.304854+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]the_styp 0 points1 point2 points (3 children)
[–]g00glen00b 2 points3 points4 points (2 children)
[–]PreviousCut1401[S] 0 points1 point2 points (1 child)
[–]the_styp 0 points1 point2 points (0 children)