I have written an HandlerInterceptorAdapter implementation and would like to exclude the path patterns that authenticate the user and refresh the user while registering token, the URLS of thje resource mostly has the email address as a path param, which of the below code snippet is a valid form to do so
@Override
public void addInterceptors(InterceptorRegistry registry) {
super.addInterceptors(registry);
registry.addInterceptor(new AuthorizationInterceptor()).excludePathPatterns("/somepath/*/someresource/*");
}
or
@Override
public void addInterceptors(InterceptorRegistry registry) {
super.addInterceptors(registry);
registry.addInterceptor(new AuthorizationInterceptor()).excludePathPatterns("/somepath/{email}/someresource/*");
}
EDIT:::
Enhanced the code using the PatternMatcher, still not working
@Override
public void addInterceptors(InterceptorRegistry registry) {
super.addInterceptors(registry);
registry.addInterceptor(new AuthorizationInterceptor())
.excludePathPatterns(
"/somepath",
"/somepath/*/authenticate",
"somapath/*/someresource/verify"
).pathMatcher(new AntPathMatcher());
}