简体   繁体   English

在Spring Boot OAuth2服务器上验证Cron作业

[英]Authenticate Cron Job on Spring Boot OAuth2 Server

I have 2 microservices: 我有2个微服务:

  • the first one is an Authorization and Resource Server 第一个是授权和资源服务器
  • the second microservice is a Resource server with a cron job 第二个微服务是具有cron作业的资源服务器

That cron job make requests to the first microservice, but it needs a token in order to make requests to the first microservice. 该cron作业向第一个微服务发出请求,但是它需要一个令牌才能向第一个微服务发出请求。

How can i get a token for cron job? 如何获得Cron工作的代币?

You cannot get a token from cron. 您无法从cron获得令牌。 Cron is nothing more then a time table to start an executable. Cron只不过是启动可执行文件的时间表。 You could, however, have the executable started by cron, providing a token. 但是,您可以使可执行文件由cron启动,并提供一个令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM