Class OAuthRedirectionFilter
java.lang.Object
de.hybris.platform.commercewebservices.core.request.redirection.OAuthRedirectionFilter
- All Implemented Interfaces:
javax.servlet.Filter
This filter was created only because of compatibility reason and is not turn on by default.
It can be add in web.xml to inform occ clients that oauth token request was moved to different location.
Example :
It can be add in web.xml to inform occ clients that oauth token request was moved to different location.
Example :
<filter>
<filter-name>oauthRedirectionFilter</filter-name>
<filter-class>de.hybris.platform.commercewebservices.core.request.redirection.OAuthRedirectionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>oauthRedirectionFilter</filter-name>
<url-pattern>/oauth/*</url-pattern>
</filter-mapping>
Filter can be also parameterized :
<filter>
<filter-name>oauthRedirectionFilter</filter-name>
<filter-class>de.hybris.platform.commercewebservices.core.request.redirection.OAuthRedirectionFilter</filter-class>
<init-param>
<param-name>redirectStatus</param-name>
<param-value>307</param-value>
</init-param>
<init-param>
<param-name>oauthWebRoot</param-name>
<param-value>/authorizationserver</param-value>
</init-param>
<init-param>
<param-name>oauthServer</param-name>
<param-value>localhost</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>oauthRedirectionFilter</filter-name>
<url-pattern>/oauth/*</url-pattern>
</filter-mapping>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) protected StringgetAbsoluteURL(javax.servlet.http.HttpServletRequest httpRequest, String url, String serverName) protected StringgetFinalUrl(javax.servlet.http.HttpServletRequest httpRequest) voidinit(javax.servlet.FilterConfig config) protected static StringsanitizeQueryString(String queryString)
-
Field Details
-
HTTP_PORT
protected static final int HTTP_PORT- See Also:
-
HTTPS_PORT
protected static final int HTTPS_PORT- See Also:
-
-
Constructor Details
-
OAuthRedirectionFilter
public OAuthRedirectionFilter()
-
-
Method Details
-
init
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException - Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException - Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
getFinalUrl
-
getAbsoluteURL
-
sanitizeQueryString
-