Class CsrfAuthorizer
- java.lang.Object
-
- org.pac4j.core.authorization.authorizer.csrf.CsrfAuthorizer
-
- All Implemented Interfaces:
Authorizer<UserProfile>
public class CsrfAuthorizer extends Object implements Authorizer<UserProfile>
Authorizer that checks CSRF tokens.- Since:
- 1.8.0
- Author:
- Jerome Leleu
-
-
Constructor Summary
Constructors Constructor Description CsrfAuthorizer()
CsrfAuthorizer(String parameterName, String headerName)
CsrfAuthorizer(String parameterName, String headerName, boolean checkAllRequests)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHeaderName()
String
getParameterName()
boolean
isAuthorized(WebContext context, List<UserProfile> profiles)
Checks if the user profiles and / or the current web context are authorized.boolean
isCheckAllRequests()
void
setCheckAllRequests(boolean checkAllRequests)
void
setHeaderName(String headerName)
void
setParameterName(String parameterName)
-
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized(WebContext context, List<UserProfile> profiles)
Description copied from interface:Authorizer
Checks if the user profiles and / or the current web context are authorized.- Specified by:
isAuthorized
in interfaceAuthorizer<UserProfile>
- Parameters:
context
- the web contextprofiles
- the user profiles- Returns:
- if the access is authorized
-
getParameterName
public String getParameterName()
-
setParameterName
public void setParameterName(String parameterName)
-
getHeaderName
public String getHeaderName()
-
setHeaderName
public void setHeaderName(String headerName)
-
isCheckAllRequests
public boolean isCheckAllRequests()
-
setCheckAllRequests
public void setCheckAllRequests(boolean checkAllRequests)
-
-