Comments (1)
I'm afraid this is more of a AWS library question then something specific to AWSMqtt. This library only expects the passed credential object to have an async get
function that calls back when credentials are loaded or refreshed, then creates a signed url with them.
Line 35 in b373503
I would try something like this:
const sts = new AWS.STS();
const myStsCredentials = {
accessKeyId: null,
secretAccessKey: null,
sessionToken: null,
get: function (callback) {
const thisObj = this;
sts.assumeRole({...}, function (err, data) {
if (err) return callback(err); // an error occurred
else { // successful response
thisObj.accessKeyId = data.Credentials.AccessKeyId;
thisObj.secretAccessKey = data.Credentials.SecretAccessKey;
thisObj.sessionTocken = data.Credentials.SessionToken;
return callback(null, thisObj);
}
});
}
}
const client = new AWSMqttClient({
credentials: myStsCredentials,
...
})
from aws-mqtt.
Related Issues (20)
- mqttClient.end() result with clientInitiatedDisconnect = False HOT 1
- Issue with last will message HOT 1
- Messages show as being published yet do not appear in MQTT HOT 1
- Working with AWS EC2MetadataCredentials Provider HOT 1
- process.version.split is not a function HOT 3
- Error in connection establishment HOT 1
- Error in Angular 8+ HOT 2
- Upon connecting, cannot subscribe without setting client.connected = true
- Cognito Auth tokens and long running websocket
- Config Publish and subscribe topic with QOS1! HOT 1
- Inability to set clean flag to false
- How can I end correctly the connection?
- Socket Closing Abruptly HOT 1
- Code 1005 is reserved and may not be used in React Native
- crypto could not be found within the project. HOT 1
- Expires option and keepalive option of MQTT.js are the same ?
- When I running node timePublisher.js I couldn’t subscribe to a specific topic, it’s just publishing
- Risk: over-authorization of AWS IoT policy
- severity vulnerabilities due to dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-mqtt.