package com.cm.common.plugin.converter;

import com.cm.common.config.properties.OauthClientProperties;
import com.cm.common.config.properties.OauthProperties;
import com.cm.common.plugin.oauth.token.ClientTokenManager;
import com.cm.common.plugin.utils.RestTemplateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;

/**
 * @ClassName: UserAccessTokenConverter
 * @Description: 用户jwt token
 * @Author: WangGeng
 * @Date: 2019/2/28 3:26 PM
 * @Version: 1.0
 **/
public class ClientUserAccessTokenConverter extends DefaultAccessTokenConverter {

    public ClientUserAccessTokenConverter(OauthProperties oauthProperties, RestTemplateUtil restTemplateUtil) {
        super();
        ClientUserAuthConverter clientUserAuthConverter = new ClientUserAuthConverter();
        clientUserAuthConverter.setOauthProperties(oauthProperties);
        clientUserAuthConverter.setRestTemplateUtil(restTemplateUtil);
        super.setUserTokenConverter(clientUserAuthConverter);
    }
}
