#Spring Security for OAuth (upgrade given sample to Spring 3)

1 messages · Page 1 of 1 (latest)

lean gyro
#

https://spring.io/guides/tutorials/spring-boot-oauth2 Been going through this and trying to upgrade it to use spring 3.0 A lot of details looked transferrable but I'm getting unauthorized 401 on / (home page). I thought that the following would allow access without any auth restrictions for the given paths:

    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
        logger.debug("Configuring SecurityFilterChain");
        SimpleUrlAuthenticationFailureHandler handler = new SimpleUrlAuthenticationFailureHandler("/");
        http
            .authorizeHttpRequests(authz -> authz
                    .requestMatchers("/").permitAll()
                    .requestMatchers("/error/**").permitAll()
                    .requestMatchers("/webjars/**").permitAll()
                    .anyRequest().authenticated()
            )

Also welcome any tips in general

Getting Started | Spring Boot and OAuth2

A tutorial on "social" login and single sign on with Facebook and Github

unique matrixBOT
#

<@&1004656351647117403> please have a look, thanks.

lean gyro
unique matrixBOT
#

@lean gyro

Your question has been closed due to inactivity.

If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.

Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.

When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.

Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.

With enough info, someone knows the answer for sure 👍

lean gyro
#

I still need help 😔

sacred isle
#

try asking chat GPT steps or you can see whats error about and google it.

lean gyro
#

That linkedk page kind of appears to be an LLM output too, and I did ask the integrated Jetbrains AI Assistant (GPT4o model) but it's not apparent to it even after scanning the project dir.

I did find a Stackoverflow post with a potentially working example by a responder: https://stackoverflow.com/questions/78642561/java-spring-boot-3-spring-security-oauth2-unauthenticated-endpoint might bounce off their work and see if that provides a better outcome