diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache index 3e86330c91bb..031df6227631 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache @@ -8,15 +8,23 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +{{#authMethods}} +{{#isOAuth}} import org.springframework.cloud.security.oauth2.client.feign.OAuth2FeignRequestInterceptor; import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext; -import org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails; +{{/isOAuth}} +{{#isApplication}} import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails; +{{/isApplication}} +{{#isCode}} import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails; +{{/isCode}} +{{#isImplicit}} import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails; +{{/isImplicit} +{{#isPassword}} import org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails; -import org.springframework.security.oauth2.common.exceptions.InvalidGrantException; -import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; +{{/isPassword}} @Configuration @EnableConfigurationProperties