Geeksltd / Olive

Olive framework, for more productive cross platform .NET solutions. It's available under the GPL v3 license. See License.md for more information.
https://geeksltd.github.io/Olive
Other
44 stars 44 forks source link

Aws token expiration error #343

Closed AmirHJabari closed 2 years ago

AmirHJabari commented 2 years ago

Olive.Aws/AssumeRole.cs In this class, everything is working as it should but maybe we are using it in the wrong way. When the token is expired I call SignalRenew() and this code executes successfully without any problems.

FallbackCredentialsFactory.Reset();
FallbackCredentialsFactory.CredentialsGenerators.Insert(0, () => response.Credentials);

But it still gives me a Token Expiration Error for a while maybe an hour. Then it will be fixed for an hour and again the same problem (I'm not sure about the pattern) ... Maybe we should update the token in another way.

@m-sadegh-sh @PaymonK

PaymonK commented 2 years ago

In the AssumeRole security model, the credential expires after a while and should be refreshed. In the usage guide, we have SignalRenew, designed to be called every 5 minutes (which is called upon receiving every http request). That is not the problem.

The problem was that we are caching the AWS Client object in EventBus. It's fixed now.