Last active
March 20, 2020 01:08
-
-
Save thinkmicroservices/b7042b2a45d3db92bfe525eee25ca3c2 to your computer and use it in GitHub Desktop.
AuthenticationFilter:FilterConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thinkmicroservices.ri.spring.auth; | |
import com.thinkmicroservices.ri.spring.auth.jwt.JWTAuthorizationFilter; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.boot.web.servlet.FilterRegistrationBean; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
/** | |
* | |
* @author cwoodward | |
*/ | |
@Configuration | |
@Slf4j | |
public class FilterConfig { | |
protected static final String URL_PATTERN = "/*"; | |
/** | |
* | |
* @return | |
*/ | |
@Bean | |
public FilterRegistrationBean<JWTAuthorizationFilter> jwtFilterRegistration() { | |
FilterRegistrationBean<JWTAuthorizationFilter> filterRegistrationBean | |
= new FilterRegistrationBean<>(new JWTAuthorizationFilter()); | |
filterRegistrationBean.addUrlPatterns(URL_PATTERN); | |
log.debug("JWTFilter patterns {}", filterRegistrationBean.getUrlPatterns()); | |
return filterRegistrationBean; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment