atdatabases icon indicating copy to clipboard operation
atdatabases copied to clipboard

How to authenticate using cleartext?

Open kpeters-cbsi opened this issue 5 years ago • 2 comments

I'd like to use @databases to connect to an Amazon RDS proxy. The proxy uses IAM authentication, which requires the use of the mysql_clear_password authentication plugin. I don't see anything in the docs about authentication plugins. Can you help?

See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.AWSCLI.html for an example of using the MySQL CLI to connect to an RDS instance with IAM authentication.

kpeters-cbsi avatar Apr 24 '20 22:04 kpeters-cbsi

If anyone can provide a sample of how to do this using the underlying mysql2 library, I'd be happy to take a look at this. Better yet, someone could provide a pull request for this.

ForbesLindesay avatar Feb 15 '22 12:02 ForbesLindesay

Looking at my code that's connecting to the RDS proxy, it looks like all I'm doing is this:

import { createConnection } from 'mysql2/promise';

let connection = await createConnection({ host: 'MyProxyHostname', user: 'MyUsername', password: 'MyPassword', port: 3306, ssl: 'Amazon RDS' });
// do stuff w/ connection

kpeters-cbsi avatar Feb 15 '22 17:02 kpeters-cbsi