title: Spring Not Storing Okta JSESSIONID from Auth Redirect Response
body: <p>I'm trying to secure my application with SSO. I can get user redirected to Okta's auth page, but once they authenticate with that the JSESSION Id isn't stored in spring. I get an error in the Spring logs:</p>
  <pre><code>GET &quot;/oauth2/redirect/okta?code={code}&amp;state={state}&quot;, parameters={masked}
  Mapped to ResourceHttpRequestHandler [&quot;classpath:/META-INF/resources/&quot;, &quot;classpath:/resources/&quot;, &quot;classpath:/static/&quot;, &quot;classpath:/public/&quot;, &quot;/&quot;]
  Resource not found
  Completed 404 NOT_FOUND
  </code></pre>
  <p>So it looks like Spring is confused about the GET response being called as part of the redirect. I have my Security config set up like this:</p>
  <pre><code>public static class AuthConfiguration extends WebSecurityConfigurerAdapter {
  
          @Autowired
          ClientRegistrationRepository clientRegRepo;
  
          @Autowired
          OAuth2AuthorizedClientService clientService;
  
          @Override
          protected void configure(HttpSecurity http) throws Exception {
              http
                      .authorizeRequests()
                      .antMatchers(&quot;/oauth_login&quot;, &quot;/oauth2/**&quot;)
                      .permitAll()
                      .and()
                      .oauth2Login()
                      .clientRegistrationRepository(clientRegRepo)
                      .authorizedClientService(clientService);
         }
  }
  </code></pre>
  <p>The full project can be found <a href="https://github.com/WyattPearson/spring-oauth2-test" rel="nofollow noreferrer">here</a>.</p>
  <p>Is there something I need to do with Spring OAuth2 to tell it to store jsessionid's into it's security context?</p>