Skip to content

A MySQL authentication plugin for Java that implements the client-side of MongoDB authentication mechanisms supported by mongosqld

License

Notifications You must be signed in to change notification settings

mongodb/mongosql-auth-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongosql-java-auth

A MySQL authentication plugin that implements the client-side of MongoDB-supported authentication mechanisms, including

  • SCRAM-SHA-1
  • PLAIN
  • GSSAPI

Usage

Include this library in the classpath. The Maven coordinates are:

<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongosql-auth-mysql</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Next, add a reference to the authentication plugin via the MySQL connection string:

jdbc:mysql://127.0.0.1:3307?useSSL=false&authenticationPlugins=org.mongodb.mongosql.auth.plugin.MongoSqlAuthenticationPlugin

Optionally, specify the authentication mechanism via a query parameter on the user name. The default mechanism is SCRAM-SHA-1.
For example:

username?mechanism=GSSAPI   

Optionally, specify the authentication source via a query parameter on the user name. The default source is "admin" for SCRAM-SHA-1 and MONGODB-CR, and "$external" for PLAIN and GSSAPI. For example:

username?source=somedb

Notes

  • The SCRAM-SHA-1 mechanism hashes the passwords in the client plugin, so it can be used on an unencrypted connection without exposing the password.
  • The PLAIN mechanism sends the password in cleartext, so should only be used on an encrypted connection, though this is not enforced.

About

A MySQL authentication plugin for Java that implements the client-side of MongoDB authentication mechanisms supported by mongosqld

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages