Return a valid credentials. Please note mqtt.js does not support promises, meaning that credentials provider implementation should handle application-level authentication refreshing so that the websocket connection could simply grab the latest valid tokens when getCredentials() get called.
AWSCredentials
Invoked by browser MQTT clients before a connection is attempted. Sub-classes that source credentials asynchronously should override this API to perform asynchronous credentials resolution.
Asynchronous providers that cache session-based credentials should resolve the returned promise if the cached credentials are still valid.
a promise that resolves if credentials were successfully refreshed, rejected otherwise.
Generated using TypeDoc
StaticCredentialProvider. The provider will always return the static AWSCredential.