看了课程后,自己动手搭建基于spring cloud gateway +oauth2.0+jwt方式搭建一套认证与鉴权服务在搭建完代码后,测试时候出现如下问题:
{"error":"unauthorized","error_description":"Error creating bean with name 'scopedTarget.clientDetailsService' defined in class path resource [org/springframework/security/oauth2/config/annotation/configuration/ClientDetailsServiceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.provider.ClientDetailsService]: Factory method 'clientDetailsService' threw exception; nested exception is java.lang.UnsupportedOperationException: Cannot build client services (maybe use inMemory() or jdbc())."}
我之前初步也是以为没有配置client的但是在实际代码已经添加了配置了,如下:
Spring Security技术栈,REST风格开发常见接口,独立开发认证授权模块保证REST服务安全
了解课程