Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

springcloud 整合oauth2.0中client_secret的问题

在oauth2.0默认的表oauth_client_details字段中client_secret字段的数据是通过一个明文比如:123456 然后通过

BCryptPasswordEncoder 加密的

为什么调用 oauth/token获取token数据时,

传的client_secret不能是加密后的,而是传明文才能获取到token

password模式:

 @Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    
        /*
         * 从数据库中获取客户端数据 这里配置的信息是 oauth_client_details表存的数据,
        */

        JdbcClientDetailsServiceBuilder jcsb = clients.jdbc(dataSource);
        jcsb.passwordEncoder(passwordEncoder);

    }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...