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

com.dream.utils.SecurityHelper Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
package com.dream.utils;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;


public class SecurityHelper {

    public static boolean isLogged() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (authentication != null && authentication.getPrincipal() instanceof User) {
            return authentication.isAuthenticated();
        }
        return false;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy