Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3655

Login screen is displayed after upgrade spring authorization server to latest

$
0
0

I have an issue after upgrade spring boot and spring security authorization server to latest version by default spring security redirects to login page. I am using spring security OAuth2ResourceServer to authenticate my end points before upgrade my application login page only displayed if I hit the base url http://localhost:8080. I configured the below code in my application

@Bean    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception    {        LOGGER.info("Configuring web security...");        http                .csrf(AbstractHttpConfigurer::disable)                .logout(AbstractHttpConfigurer::disable)                .headers(headers -> headers                        .frameOptions(HeadersConfigurer.FrameOptionsConfig::sameOrigin)                        .xssProtection(xXssConfig -> xXssConfig.headerValue(                                XXssProtectionHeaderWriter.HeaderValue.ENABLED_MODE_BLOCK))                        .referrerPolicy(referrerPolicy ->                                referrerPolicy.policy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN))                        .permissionsPolicy(permissionsPolicy -> permissionsPolicy.policy("geolocation=()")));                .oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())                    .authorizeHttpRequests(authorizeHttpRequest -> authorizeHttpRequest.                       requestMatchers(new AntPathRequestMatcher("/api/**)).authenticated()                .anyRequest().permitAll());        return build(http);    }

Can you all give a suggestion to resolve this issue ?


Viewing all articles
Browse latest Browse all 3655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>