package com.ai.da.common.security;

import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author: dangweijian
 * @description: 认证管理器
 * @create: 2020-07-10 15:58
 **/
@Component
public class UserAuthenticationManager implements AuthenticationManager {

    @Resource
    private UserAuthenticationProvider userAuthenticationProvider;

    @Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        return userAuthenticationProvider.authenticate(authentication);
    }
}
