Hi, John. I am reading your book. But it occurred a Error while config Oauth2RestTemplate. The Following is my Bean code:
@Bean
public OAuth2RestTemplate oAuth2RestTemplate(OAuth2ProtectedResourceDetails details, @Qualifier("oauth2ClientContext") OAuth2ClientContext context) {
return new OAuth2RestTemplate(details, context);
}
The Following is consle stack trace info:
Description:
Parameter 0 of method oAuth2RestTemplate in com.isaac.licenses.LicenseApplication required a bean of type 'org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails' that could not be found.
The following candidates were found but could not be injected:
- Bean method 'oauth2RemoteResource' in 'OAuth2RestOperationsConfiguration.SingletonScopedConfiguration' not loaded because AnyNestedCondition 0 matched 2 did not; NestedCondition on OAuth2RestOperationsConfiguration.ClientCredentialsCondition.NoWebApplication @ConditionalOnWebApplication found 'session' scope and did not find reactive web application classes; NestedCondition on OAuth2RestOperationsConfiguration.ClientCredentialsCondition.ClientCredentialsConfigured @ConditionalOnProperty (security.oauth2.client.grant-type=client_credentials) did not find property 'grant-type'
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails' in your configuration.
I am using SpringBoot 2.2.4.RELEASE and SpringCloud Hoxton.SR1 and spring-cloud-starter-oauth2
Hi, John. I am reading your book. But it occurred a Error while config Oauth2RestTemplate. The Following is my Bean code:
The Following is consle stack trace info:
I am using
SpringBoot 2.2.4.RELEASE
andSpringCloud Hoxton.SR1
andspring-cloud-starter-oauth2