Skip to content

Commit

Permalink
fix(oauth2): Add before filter to fix basic auth (#899) (#912)
Browse files Browse the repository at this point in the history
  • Loading branch information
spinnakerbot authored and louisjimenez committed Sep 27, 2019
1 parent fd0128a commit 2cdf6f9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import org.springframework.security.web.authentication.LoginUrlAuthenticationEnt
import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
import org.springframework.session.web.http.DefaultCookieSerializer
import org.springframework.stereotype.Component
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter

import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
Expand Down Expand Up @@ -81,6 +83,7 @@ class OAuth2SsoConfig extends WebSecurityConfigurerAdapter {
authConfig.configure(http)

http.exceptionHandling().authenticationEntryPoint(entryPoint)
http.addFilterBefore(new BasicAuthenticationFilter(authenticationManager()), UsernamePasswordAuthenticationFilter)
http.addFilterBefore(externalAuthTokenFilter, AbstractPreAuthenticatedProcessingFilter.class)
}

Expand Down

0 comments on commit 2cdf6f9

Please sign in to comment.