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

com.payneteasy.superfly.security.exception.AuthenticationCarryingException Maven / Gradle / Ivy

Go to download

Module for Spring Security which enables application to use Superfly authentication/authorization declaratively through Spring Security

There is a newer version: 1.7-32
Show newest version
package com.payneteasy.superfly.security.exception;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;

/**
 * This is added because we need to transport Authentication
 * instance in our multi-step login flows.
 * In Spring Security (about version 4), Authentication
 * was removed from AuthenticationException to avoid data leakage.
 * We only use this for two classes: {@link StepTwoException} and
 * {@link InsufficientAuthenticationException} for which leakage
 * does not make any harm.
 *
 * @author rpuch
 */
abstract class AuthenticationCarryingException extends AuthenticationException
        implements AuthenticationCarrier {
    private Authentication authentication;

    protected AuthenticationCarryingException(String message, Throwable cause) {
        super(message, cause);
    }

    protected AuthenticationCarryingException(String message) {
        super(message);
    }

    @Override
    public Authentication getAuthentication() {
        return authentication;
    }

    public void setAuthentication(Authentication authentication) {
        this.authentication = authentication;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy