Example usage for org.springframework.security.web.authentication.preauth PreAuthenticatedCredentialsNotFoundException PreAuthenticatedCredentialsNotFoundException

List of usage examples for org.springframework.security.web.authentication.preauth PreAuthenticatedCredentialsNotFoundException PreAuthenticatedCredentialsNotFoundException

Introduction

In this page you can find the example usage for org.springframework.security.web.authentication.preauth PreAuthenticatedCredentialsNotFoundException PreAuthenticatedCredentialsNotFoundException.

Prototype

public PreAuthenticatedCredentialsNotFoundException(String msg) 

Source Link

Usage

From source file:org.appverse.web.framework.backend.api.helpers.security.SessionAttributePreAuthenticatedProcessingFilter.java

@Override
protected Object getPreAuthenticatedPrincipal(HttpServletRequest request) {
    HttpSession httpSession = request.getSession(false);
    if (httpSession == null) {
        throw new PreAuthenticatedCredentialsNotFoundException(
                principalSessionAttribute + " attribute not found in session.");
    }//from w w  w  .  ja  v  a 2  s  . c  o  m
    String principal = (String) httpSession.getAttribute(principalSessionAttribute);
    if (principal == null) {
        throw new PreAuthenticatedCredentialsNotFoundException(
                principalSessionAttribute + " attribute not found in session.");
    }
    return principal;
}