Skip to content

IAM Database Authentication results in Authentication fallback / failure #268

@iamcarbon

Description

@iamcarbon

When attempting to authenticate to MySQL using IAM authentication, we seem to be attempting to switch protocols and falling back to "mysql_clear_password".

This may have have something to do with AWS reusing the user & password properties. Will do some more digging -- but posting here for now to track the issue.

DB USER

CREATE USER testing IDENTIFIED WITH AWSAuthenticationPlugin as 'RDS';        

CONNECTION STRING

var sb = new StringBuilder();

var token = rds.GenerateAuthenticationToken(
    new GetAuthenticationTokenRequest(endpoint.Host, endpoint.Port, username)
);

sb.Append($"Server={endpoint.Host};");
sb.Append($"Database={schema};");
sb.Append("SslMode=Required;");
sb.Append($"user={username};");
sb.Append($"password={token};");

return sb.ToString();

ERROR WHEN CONNECTING

System.NotSupportedException : Authentication method 'mysql_clear_password' is not supported.

MySql.Data.Serialization.MySqlSession.<SwitchAuthenticationAsync>d__50.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MySql.Data.Serialization.MySqlSession.<ConnectAsync>d__48.MoveNext()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions