I am using a tool that connects to a postgres database usinga URI string to connect. Normally this has worked fine for me by just doing postgres://<username>:<password>@<host>:<port>/<database>. However, I have moved my database to AWS RDS and now for the database password I am now using an auth token. The token looks like:
rdspostgres.cdgmuqiadpid.us-west-2.rds.amazonaws.com:5432/?Action=connect&DBUser=jane_doe&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=900...
When I put this in for the password it is not able to parse correctly because of the token format. For example i get the error psql: invalid URI query parameter: "Action". How do I use tokens as passwords for a string? Is there a way I need to encode it?
Also worth noting that for sanity check I tried connecting with psql -d $DATABASE -p $PORT -U $USER --no-password, having set $PGPASSWORD as an environment variable. This worked great and I was able to connect, so it has to be something with parsing the password string.