报错信息
Caused by: org.springframework.beans.factory.BeanCreationException: 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.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [interface java.util.Map] and content type [text/html;charset=UTF-8]
报以上错误的原因是应为我们没有配置jwt的key-value参数
我们只需要配置
security:
oauth2:
client:
client-id: member-service
client-secret: member123
access-token-uri: http://localhost:8100/oauth/token
user-authorization-uri: http://localhost:8100/oauth/authorize
resource:
jwt:
key-uri: http://localhost:8100/oauth/token_key
# 报错增加下列配置即可
key-value: member123
错误跳转地址错误
error="invalid_grant", error_description="Invalid redirect: http://localhost:8400/login does not match one of the registered values."```  场景是为我们访问客户端的接口localhost:8400/member/list准备跳转套登录界面。 在获取授权成功后,发现跳转地址出现问题,使用了我们客户端项目的地址前缀。 解决方案:  增加如图所以的配置 错误3
error=“invalid_request”, error_description=“At least one redirect_uri must be registered with the client.”
 我们配置了数据库存储客户端的认证信息,数据表中没有配置跳转的URL  解决方案增加跳转地址。



