Amazon Web Services offers a way to connect to a MySQL or PostgreSQL database without having a password, instead an authentication token can be used.
Within AWS this type of authentication is called RDS IAM.
Users don’t need to store an username and password and credentials don’t need to be stored in the database, which makes this a secure authentication method.
So, this makes it interesting to use this in your Spring Boot application. Spring Boot will use a HikariCP connection pool by default, but HikariCP 4.0.3 doesn’t support the use of authentication tokens.
So, how do I make this work within my Spring Boot application?
Enable RDS IAM for your database
Create a custom Hikari DataSource
Update application properties