嗨,我在springboot中实现了oauth2服务。验证服务器和资源服务器已通过eureka客户端启用,它们也已成功注册到eureka服务器。
这样配置资源服务器中auth-server的URIcv2.waitKey(60000)
上面的URI中的import time
prev_time = time.time()
count = 0
delay = 1 # in seconds
while True:
if time.time()-prev_time > delay:
count += 1
print(count)
prev_time = time.time()
现在是authserver的应用程序名称。我希望资源服务器从eureka服务器解析出网址后,应该使用security:
oauth2:
resource:
token-info-uri: http://auth-server/oauth/check_token
与auth服务器联系。但是通过这种设置,我得到了一个错误auth-server
我对此进行了修改
token-info-uri
但我得到回应
nested exception is java.net.UnknownHostException: auth-server
调试时,我有此日志
security:
oauth2:
resource:
prefer-token-info: false
service-id: auth-server
token-info-uri: http://${security.oauth2.resource.service-id}/oauth/check_token
loadBalanced: true
我看到的基本上是URI