Skip to content

Commit

Permalink
OAuth 2 Autoconfiguration 401 Error for preflight request spring-atti…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ropi committed Sep 17, 2019
1 parent 5df8fc1 commit 392c1ac
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -19,6 +19,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
Expand Down Expand Up @@ -86,9 +87,10 @@ protected void configure(HttpSecurity http) throws Exception {
// @formatter:off
http
.authorizeRequests()
.antMatchers(tokenEndpointPath).fullyAuthenticated()
.antMatchers(tokenKeyPath).access(configurer.getTokenKeyAccess())
.antMatchers(checkTokenPath).access(configurer.getCheckTokenAccess())
.antMatchers(HttpMethod.OPTIONS, tokenEndpointPath).permitAll()
.antMatchers(tokenEndpointPath).fullyAuthenticated()
.antMatchers(tokenKeyPath).access(configurer.getTokenKeyAccess())
.antMatchers(checkTokenPath).access(configurer.getCheckTokenAccess())
.and()
.requestMatchers()
.antMatchers(tokenEndpointPath, tokenKeyPath, checkTokenPath)
Expand Down

0 comments on commit 392c1ac

Please sign in to comment.