public class AuthInterceptor<T>
extends java.lang.Object
implements jodd.madvoc.interceptor.ActionInterceptor
Authentication checking interceptor. Provides auto-login using cookies.
Authentication pertains to the question "Who are you?". Usually a user authenticates himself by successfully associating his "principal" (often a username) with his "credentials" (often a password).
Authorization checking interceptor.
Authorization pertains to the question "What may you do?". In JEE applications, this is achieved by making secured resources accessible ("requestable" in web applications) to particular "roles". Principals (i.e. users) who are associated with one or more of these roles will have access to those resources.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
authenticateViaBasicAuth |
protected boolean |
return404instead401 |
static UserAuth |
userAuth
Simple static HOOK for the implementation.
|
| Constructor and Description |
|---|
AuthInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected T |
authenticateUserViaBasicAuth(jodd.madvoc.ActionRequest actionRequest)
Tires to authenticate user via the basic authentication.
|
protected T |
authenticateUserViaHttpSession(jodd.madvoc.ActionRequest actionRequest)
Tries to authenticate user via HTTP session.
|
protected T |
authenticateUserViaToken(jodd.madvoc.ActionRequest actionRequest)
Tries to authenticate user via token.
|
protected boolean |
authorized(jodd.madvoc.ActionRequest actionRequest)
Hook method for authorization of action requests.
|
java.lang.Object |
intercept(jodd.madvoc.ActionRequest actionRequest) |
void |
setAuthenticateViaBasicAuth(boolean authenticateViaBasicAuth) |
void |
setReturn404instead401(boolean return404instead401) |
public static UserAuth userAuth
protected boolean return404instead401
protected boolean authenticateViaBasicAuth
public void setReturn404instead401(boolean return404instead401)
public void setAuthenticateViaBasicAuth(boolean authenticateViaBasicAuth)
public java.lang.Object intercept(jodd.madvoc.ActionRequest actionRequest)
throws java.lang.Exception
intercept in interface jodd.madvoc.interceptor.ActionInterceptorjava.lang.Exceptionprotected T authenticateUserViaHttpSession(jodd.madvoc.ActionRequest actionRequest)
protected T authenticateUserViaToken(jodd.madvoc.ActionRequest actionRequest)
protected T authenticateUserViaBasicAuth(jodd.madvoc.ActionRequest actionRequest)
protected boolean authorized(jodd.madvoc.ActionRequest actionRequest)
Copyright © 2003-present Jodd Team