package com.ytpm.config.custom;

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

import java.util.Collection;

public class ClientAuthentication implements Authentication {
    private static ClientAuthentication authentication = null;
    private ClientAuthentication() {

    }
    public static ClientAuthentication getAuthentication() {
        if (null == authentication) {
            synchronized (ClientAuthentication.class) {
                if (null == authentication) {
                    authentication = new ClientAuthentication();
                }
            }

        }
        return authentication;
    }
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getDetails() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return null;
    }

    @Override
    public boolean isAuthenticated() {
        return false;
    }

    @Override
    public void setAuthenticated(boolean b) throws IllegalArgumentException {

    }

    @Override
    public String getName() {
        return "user-client";
    }
}
