oauth2-demo
oauth2-demo copied to clipboard
Re:从零开始的Spring Security Oauth2
看了很多博客都没什么介绍如何配置授权服务器和资源服务器相关的api,能请教下这个能从哪里找到或者怎么配置么?
看了《从零开始的Spring Security Oauth2(一)》,结合github模块client-credentials-springboot2,理一下整体逻辑: 资源(服务器)和认证(服务)器都在一个项目,从认证器的/oauth/token获取token,保存到redis(endpoints.tokenStore(new RedisTokenStore(redisConnectionFactory))),然后被保护的资源,资源服务器在哪验证的这个token呢? 我尝试在资源服务器的配置方法里configure(ResourceServerSecurityConfigurer resources)通过resources. 来看自动提示, 发现有设置tokenStore的方法,这样看来,代码漏了这一段?
我在访问localhost:8081/aiqiyi/qq/redirect时控制台打印了授权码,但是带着授权码去访问token的时候报2020-03-04 13:07:14.996 ERROR 10804 --- [nio-8081-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 null] with root...
项目无法运行
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.oauth2.provider.ClientDetailsService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
springcloud的资源服务器 其中有验证token的接口 带token压测的效率很低?有没有遇到过这个问题?是因为验证token请求比较多的问题吗?
RedisConnectionFailureException, Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379
test issue