minio / minio-dotnet

MinIO Client SDK for .NET
https://docs.min.io/docs/dotnet-client-quickstart-guide.html
Apache License 2.0
575 stars 230 forks source link

STS authentication doesn't seem to deal with slight time deviations #1133

Open ramondeklein opened 4 months ago

ramondeklein commented 4 months ago

When fetching temporary credentials using STS, the returned credentials have an expiration date. When the credentials are used, then this expiration is used. It's generally better to shorten the expiration, so it can deal with:

  1. Latency between expiration check on the client and processing the actual signed request on the server.
  2. Small time deviations between client and server.

The minio-go code deals with this when storing the expiration in the client. It's always stored by decreasing the expiration date using a fixed duration or sets it at 80% of the original expiration. That will ensure that the credentials are refreshed well before they expire.