![](/img/trans.png)
[英]Spring Boot jdbcAuthentication dataSource not loaded error
[英]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.