简体   繁体   中英

Fetching Access Token in Distributed environment

I have an external api which i need to access using tokens. My service build using spring boot uses service user credentials to retrieve token and access it. These tokens are valid for particular duration. If i want to deploy multiple version of the same service for HA/scalability its causing issues when token expires or during the startup when the servers starts up in the same time. I can build a custom solution for fixing this, but i am looking for best practices and existing libraries for handling this kind of scenario. /approaches.

for distributed authorization servers: use JDBCTokenStore

In your specific case make your service app as Resource server by using @EnableResourceServer and in your application.yml file specify these properties security: oauth2: resource: token-info-uri: http://localhost:9191/oauth/check_token client: client-id: yourclientId client-secret: yourClientSecret

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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