Package uk.ac.warwick.sso.client
Class ForceLoginScreenTypeFilter
- java.lang.Object
-
- uk.ac.warwick.sso.client.ForceLoginScreenTypeFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class ForceLoginScreenTypeFilter extends java.lang.Object implements javax.servlet.FilterSSO supports a few alternate login screens for mobile and text-only user agents. By default, SSO client won't use either of these but this filter can force the type used for redirects, so that if a subsequent filter sends the user to the login screen then it will be used insteadCurrent known values are "mini" (mobile) and "text" (text only). Leave unset for the default.
If you have complex user agent needs then you can write your own filter and configure it to set the attribute
SSO_SCREEN_TYPE_KEYto "mini" when you want it to show a mobile login screen. You might do some user agent sniffing to detect this.(ForceLoginScreenTypeFilter was a bad name as it suggests it's something to do with ForceLoginFilter, or related to forcing login, which it is not.)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSSO_SCREEN_TYPE_KEY
-
Constructor Summary
Constructors Constructor Description ForceLoginScreenTypeFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voiddoFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)java.lang.StringgetScreenType()voidinit(javax.servlet.FilterConfig config)voidsetScreenType(java.lang.String screenType)
-
-
-
Field Detail
-
SSO_SCREEN_TYPE_KEY
public static final java.lang.String SSO_SCREEN_TYPE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Filter
-
doFilter
public final void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
init
public final void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
getScreenType
public final java.lang.String getScreenType()
-
setScreenType
public final void setScreenType(java.lang.String screenType)
-
-