bijukunjummen / oauth2-boot2

Sample demonstrating OAuth2/Open ID Connect with Spring Boot 2
19 stars 7 forks source link

when starting oauth2-boot2-legacy, multiple failures #2

Open spencerhuang opened 4 years ago

spencerhuang commented 4 years ago

First issue is the Bean 'scopedTarget.oauth2ClientContext' could not be registered same bean name has already been defined in class path

This issue can be resolved by modifying build.gradle to dependencies { compile 'org.springframework.cloud:spring-cloud-starter-oauth2' compile("org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.1.RELEASE")

Second issue is: `2020-03-23 15:41:16.824 ERROR 10237 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jwtTokenServices' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration.class]: Unsatisfied dependency expressed through method 'jwtTokenServices' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtTokenStore' defined in class path resource`

Error creating bean with name 'jwtTokenEnhancer' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter]: Factory method 'jwtTokenEnhancer' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 null

I am not following, why does it make a httpClient call on the start up of this Spring-boot app?