繁体   English   中英

收到令牌请求时更改jdbcAuthentication数据源

[英]Change jdbcAuthentication datasource when receiving a token request

我已经通过使用注释@EnableAuthorizationServer创建了一个Authorization Server Spring Boot应用程序。

我还创建了一个配置类,如下所示:

@Configuration
public class AuthorizationConfiguration extends GlobalAuthenticationConfigurerAdapter
{
    private DataSource datasource;

    @Override
    public void init(AuthenticationManagerBuilder auth) throws Exception
    {
        auth.jdbcAuthentication().dataSource(datasource);
    }
}

我了解启动服务器时会执行此方法。

有没有一种方法可以根据我发送的请求更改此配置?

例如

如果我发送http://localhost:9000/oauth/token我想使用datasource1

如果我发送http://test.localhost:9000/oauth/token我想使用datasource2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM