@Service
@ConditionalOnProperty(prefix="smartcosmos.gateway.pre-authorization-filter",
name="enabled",
matchIfMissing=true)
public class PreAuthorizationFilter
extends com.netflix.zuul.ZuulFilter
Filter that occurs before Zuul forwards the request to see if the provided request has a JWT. If it does not, attempts to validate existing authentication against the Auth Server and retrieve a JWT for the request.
The filter is only applied if the route for the request is not configured to be handled locally (forwarding request), i.e. it doesn't match a route like the following:
forward-route:
path: /local/**
url: forward:/**
| Constructor and Description |
|---|
PreAuthorizationFilter(AuthenticationClient authenticationClient,
org.springframework.cloud.netflix.zuul.filters.RouteLocator routeLocator) |
| Modifier and Type | Method and Description |
|---|---|
int |
filterOrder() |
String |
filterType() |
protected String[] |
getAuthenticationCredentials() |
protected javax.servlet.http.HttpServletRequest |
getRequest() |
protected String |
getResponseBody(org.springframework.http.HttpStatus statusCode,
String message,
String path) |
boolean |
isAuthorizationPath() |
boolean |
isBasicAuthRequest() |
boolean |
isForwardingRoute() |
Object |
run() |
protected void |
setErrorResponse(org.springframework.http.HttpStatus statusCode,
String message) |
boolean |
shouldFilter() |
@Autowired public PreAuthorizationFilter(AuthenticationClient authenticationClient, org.springframework.cloud.netflix.zuul.filters.RouteLocator routeLocator)
public String filterType()
filterType in class com.netflix.zuul.ZuulFilterpublic int filterOrder()
filterOrder in class com.netflix.zuul.ZuulFilterpublic boolean shouldFilter()
public boolean isForwardingRoute()
public boolean isBasicAuthRequest()
public boolean isAuthorizationPath()
protected javax.servlet.http.HttpServletRequest getRequest()
public Object run()
protected String[] getAuthenticationCredentials()
protected void setErrorResponse(org.springframework.http.HttpStatus statusCode,
String message)
Copyright © 2015–2016 Smartrac Technology Fletcher, Inc.. All rights reserved.