public class MetadataDisplayFilter
extends org.springframework.web.filter.GenericFilterBean
Modifier and Type | Field and Description |
---|---|
protected SAMLContextProvider |
contextProvider
Provider for context based on URL
|
static String |
FILTER_URL
Default name of path suffix which will invoke this filter.
|
protected String |
filterProcessesUrl
Url this filter should get activated on.
|
protected KeyManager |
keyManager
Key manager for metadata signatures
|
protected static org.slf4j.Logger |
log
Class logger.
|
protected MetadataManager |
manager
Class storing all SAML metadata documents
|
Constructor and Description |
---|
MetadataDisplayFilter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Verifies that required entities were autowired or set.
|
protected void |
displayMetadata(String spEntityName,
PrintWriter writer)
Method writes metadata document into given writer object.
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain) |
String |
getFilterProcessesUrl() |
protected String |
getMetadataAsString(org.opensaml.saml2.metadata.EntityDescriptor descriptor) |
protected boolean |
processFilter(HttpServletRequest request)
The filter will be used in case the URL of the request contains the FILTER_URL.
|
protected void |
processMetadataDisplay(HttpServletRequest request,
HttpServletResponse response)
The filter attempts to generate application metadata (if configured so) and in case the call is made
to the expected URL the metadata value is displayed and no further filters are invoked.
|
void |
setContextProvider(SAMLContextProvider contextProvider) |
void |
setFilterProcessesUrl(String filterProcessesUrl)
Custom filter URL which overrides the default.
|
void |
setKeyManager(KeyManager keyManager) |
void |
setManager(MetadataManager manager) |
protected static final org.slf4j.Logger log
protected MetadataManager manager
protected KeyManager keyManager
protected SAMLContextProvider contextProvider
protected String filterProcessesUrl
public static final String FILTER_URL
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
IOException
ServletException
protected boolean processFilter(HttpServletRequest request)
request
- request used to determine whether to enable this filterprotected void processMetadataDisplay(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
request
- requestresponse
- responseServletException
- errorIOException
- io errorprotected void displayMetadata(String spEntityName, PrintWriter writer) throws ServletException
spEntityName
- id of entity to display metadata forwriter
- output for metadataServletException
- error retrieving or writing the metadataprotected String getMetadataAsString(org.opensaml.saml2.metadata.EntityDescriptor descriptor) throws org.opensaml.xml.io.MarshallingException
org.opensaml.xml.io.MarshallingException
@Autowired public void setManager(MetadataManager manager)
@Autowired public void setContextProvider(SAMLContextProvider contextProvider)
@Autowired public void setKeyManager(KeyManager keyManager)
public String getFilterProcessesUrl()
public void setFilterProcessesUrl(String filterProcessesUrl)
filterProcessesUrl
- filter URLpublic void afterPropertiesSet() throws ServletException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.web.filter.GenericFilterBean
ServletException