|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.surfnet.oaaas.auth.AbstractFilter
org.surfnet.oaaas.auth.AbstractAuthenticator
public abstract class AbstractAuthenticator
To be implemented by various authentication methods.
| Field Summary | |
|---|---|
static String |
PRINCIPAL
The constant that contains the principal, set by concrete authenticators and consumed by the authorization endpoint. |
| Fields inherited from class org.surfnet.oaaas.auth.AbstractFilter |
|---|
AUTH_STATE, RETURN_URI |
| Constructor Summary | |
|---|---|
AbstractAuthenticator()
|
|
| Method Summary | |
|---|---|
abstract void |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
String authStateValue,
String returnUri)
Implement this method to perform the actual authentication. |
abstract boolean |
canCommence(javax.servlet.http.HttpServletRequest request)
Implement this method to state whether the given request is a continuation that can be handled. |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
protected void |
setPrincipal(javax.servlet.ServletRequest request,
AuthenticatedPrincipal principal)
Set the given principal on the request. |
| Methods inherited from class org.surfnet.oaaas.auth.AbstractFilter |
|---|
getAuthStateValue, getReturnUri, setAuthStateValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PRINCIPAL
| Constructor Detail |
|---|
public AbstractAuthenticator()
| Method Detail |
|---|
public final void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
IOException
javax.servlet.ServletExceptionpublic abstract boolean canCommence(javax.servlet.http.HttpServletRequest request)
request - the HttpServletRequest
public abstract void authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
String authStateValue,
String returnUri)
throws IOException,
javax.servlet.ServletException
BasicAuthenticator or
FormLoginAuthenticator as an example.
In general, the contract is:
assert that the user is authenticated. You can use the request and response for this. When not yet authenticated:
AbstractFilter.getAuthStateValue(javax.servlet.ServletRequest) to
pass-around for user agent communicationAbstractFilter.getReturnUri(javax.servlet.ServletRequest) if you need to
step out and return to the current location
When authenticated:
AbstractFilter.setAuthStateValue(javax.servlet.ServletRequest, String)#setPrincipal(ServletRequest, RolesPrincipal)
request - the ServletRequestresponse - the ServletResponsechain - the original http servlet filter chainauthStateValue - the authState nonce to set back on the ServletRequest when
donereturnUri - the startpoint of the chain if you want to return from a form or
other (external) component
IOException
javax.servlet.ServletException
protected final void setPrincipal(javax.servlet.ServletRequest request,
AuthenticatedPrincipal principal)
request - the original ServletRequestprincipal - the Principal to set.
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic void destroy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||