We recently open-sourced an extension of Apache’s TinkerPop JavaScript driver compatible with Amazon’s Identity and Access Management (IAM) database authentication.

We implemented a robust and scalable solution using Amazon’s Neptune graph database and Node-based API to support the Editorial business. However, we faced a challenge when it became evident that Amazon’s IAM was the only supported authentication method for Neptune, and there was no official JavaScript driver for it.

When using IAM database authentication, each request must be signed with AWS Signature Version 4, and this signature must be provided in the headers. The problem is that the default TinkerPop Javascript driver does not allow you to provide headers when connecting to the database.

We were be able to solve the header and authentication issues by calculating the signature from given parameters and providing it automatically to another websocket library which allows us to inject headers. Thus we were able to natively connect our Node.js applications to our AWS Neptune graph database.

The driver is publicly available on npm and its source code and documentation are on GitHub.