# Spring boot upgrade from 2.7.9 to 3.1.6

**URL:** <https://devforum.okta.com/t/spring-boot-upgrade-from-2-7-9-to-3-1-6/26244>\
**Category:** Questions\
**Tags:** spring, java\
**Created:** [January 5, 2024, 12:35am UTC](https://devforum.okta.com/t/spring-boot-upgrade-from-2-7-9-to-3-1-6/26244 "2024-01-05T00:35:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashshyam](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@prashshyam](https://devforum.okta.com/u/prashshyam)\
**Post date:** [January 5, 2024, 12:35am UTC](https://devforum.okta.com/t/spring-boot-upgrade-from-2-7-9-to-3-1-6/26244/1 "2024-01-05T00:35:20Z")

</div>

I recently upgraded from spring boot 2.7.9 to 3.1.6 and using okta 3.0.4 starter.While configuring the security filter chain I use authorizeHttpRequests on HttpSecurity class and okta authenticationfails with 400 bad request error where the error says redirect\_uri should be a valid redirect\_uri.The authorization request to okta has the right redirect\_uri.If i change authorizeHttpRequests to authorizeRequests everythign works fine but authorizeRequests is deprecated in spring security 6.x.Can someone please assist on this issue?

Please refer the code below causing the issue

```auto
@Bean
    protected SecurityFilterChain configure(HttpSecurity http) throws Exception {

        http.headers(headers -> headers
                .contentSecurityPolicy(csp -> csp
                        .policyDirectives("default-src 'self';" +
                                "script-src 'self' 'unsafe-inline' 'unsafe-eval' "+applicationURL+";"+
                                "style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; " +
                                "font-src 'self' https://fonts.gstatic.com; "+
                                "connect-src 'self' "+oktaURL+"; "+
                                "style-src 'self' https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css https://fonts.googleapis.com 'unsafe-inline'; "+
                                "style-src-elem 'self' https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css 'unsafe-inline'; "
                        ))
                .addHeaderWriter(new StaticHeadersWriter("X-Permitted-Cross-Domain-Policies", "none")));
        http.authorizeHttpRequests(requests ->
                        requests.requestMatchers("/blastdetailsViewOnly").permitAll()
                                .requestMatchers("/api/**").authenticated());

        http.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())).cors(Customizer.withDefaults());
        return http.build();
    }

```

---

<div class="post-metadata">

**Author:** ![daniel.sanders](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@daniel.sanders](https://devforum.okta.com/u/daniel.sanders)\
**Post date:** [January 9, 2024, 3:21pm UTC](https://devforum.okta.com/t/spring-boot-upgrade-from-2-7-9-to-3-1-6/26244/2 "2024-01-09T15:21:14Z")

</div>

Hello prashshyam,

I would definitely suggest checking the logs on this as we outline here: [Okta Help Center (Lightning)](https://support.okta.com/help/s/article/The-redirect-uri-parameter-must-be-an-absolute-URI) - in this case this would be for visibility on what the exact redirectURI is that’s being sent to your Okta org. This should give some insight into a potential reason for the error.

For moving to authorizeHttpRequests I would also suggest reviewing the code snippets here: [Authorize HttpServletRequests :: Spring Security](https://docs.spring.io/spring-security/reference/servlet/authorization/authorize-http-requests.html) - there are quite a few examples of syntax for doing similar request matching to what you already have there.

When looking at our current version of the SDK (3.0.6) I see authorizeRequests is still in use, so if these suggestions don’t work and updating to 3.0.6 doesn’t help I would suggest opening a case with Okta Support so we can assist you further regarding this issue. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 8, 2024, 3:21pm UTC](https://devforum.okta.com/t/spring-boot-upgrade-from-2-7-9-to-3-1-6/26244/3 "2024-02-08T15:21:21Z")

</div>

Closed on February 8, 2024, 3:21pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
