Package org.forgerock.oauth2.core
Class CsrfProtection
- java.lang.Object
-
- org.forgerock.oauth2.core.CsrfProtection
-
public class CsrfProtection extends Object
This class provides methods for checking if a request is a part of a cross-site request forgery attack (CSRF).
-
-
Constructor Summary
Constructors Constructor Description CsrfProtection(ResourceOwnerSessionValidator resourceOwnerSessionValidator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisCsrfAttack(OAuth2Request request)Checks if the request contains the required "csrf" parameter and check it equals the users session id.
-
-
-
Constructor Detail
-
CsrfProtection
@Inject public CsrfProtection(ResourceOwnerSessionValidator resourceOwnerSessionValidator)
-
-
Method Detail
-
isCsrfAttack
public boolean isCsrfAttack(OAuth2Request request)
Checks if the request contains the required "csrf" parameter and check it equals the users session id.- Parameters:
request- The request.- Returns:
trueif the request is a CSRF attack,falseif not.
-
-