I was able to successfully integrate OAuth2 into my previous application (REST service) by replacing BASIC auth.
Then I got the following exception:
No qualifying bean of type [org.springframework.transaction.PlatformTransactionManager] is defined: expected single matching bean but found 2: transactionManagerDB2,transactionManager
When I remove the bean transactionManagerDB2, it started working fine. I have 2 transaction managers because I have two related databases.
Since I have InMemoryTokenStore, I am curious to demand TransactionManager. (And why Oauth cannot select "transactionManager" by default)
Somehow I set up CustomeUserDetailService through configureGlobal(AuthenticationManagerBuilder auth){}, which worked fine before and now with a single TransactionManager.
I used sparklr-boot Spring Boot application to integrate OAuth with my application. (Thanks to Dave Syer for making such a simple, easy-to-understand example)
I use:
- Spring 4.2.5
- Spring Security 4.0.4
- Spring OAuth 2.0.9
- (No Spring Download)
source
share