All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.kaizen4j.shiro.exception.InvalidCsrfTokenException Maven / Gradle / Ivy

package com.github.kaizen4j.shiro.exception;

import com.github.kaizen4j.shiro.csrf.CsrfToken;

/**
 * Thrown when an expected {@link CsrfToken} exists, but it does not match the value
 * present on the {@link javax.servlet.http.HttpServletRequest HttpServletRequest}
 *
 * @author liuguowen
 */
@SuppressWarnings("serial")
public class InvalidCsrfTokenException extends CsrfException {

    public InvalidCsrfTokenException(String message) {
        super(message);
    }

    public InvalidCsrfTokenException(String message, Throwable t) {
        super(message, t);
    }

    /**
     * @param expectedAccessToken
     * @param actualAccessToken
     */
    public InvalidCsrfTokenException(CsrfToken expectedAccessToken,
            String actualAccessToken) {
        super("Invalid CSRF Token '" + actualAccessToken + "' was found on the request parameter '"
                + expectedAccessToken.getParameterName() + "' or header '" + expectedAccessToken.getHeaderName());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy