Package org.mariadb.jdbc.plugin.credential.env

# Class EnvCredentialPlugin

java.lang.Object
org.mariadb.jdbc.plugin.credential.env.EnvCredentialPlugin

All Implemented Interfaces:
  `Supplier<Credential>`, `CredentialPlugin`

public class EnvCredentialPlugin extends Object implements CredentialPlugin
Authentication using environment variable.

default implementation use environment variable MARIADB_USER and MARIADB_PWD

example : `jdbc:mariadb://host/db?credentialType=ENV`

2 options `userKey` and `pwdKey` permits indicating which environment variable to use.

## Constructor Summary

Constructors
Constructor
Description
`EnvCredentialPlugin()`

## Method Summary

Modifier and Type
Method
Description
`Credential`
`get()`
`CredentialPlugin`
`initialize(Configuration conf, String userName, HostAddress hostAddress)`
Permit initializing plugin if overridden
`String`
`type()`
credential identifier

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.mariadb.jdbc.plugin.CredentialPlugin

`defaultAuthenticationPluginType, mustUseSsl`

## Constructor Details

### EnvCredentialPlugin

public EnvCredentialPlugin()

## Method Details

### type

public String type()
Description copied from interface: `CredentialPlugin`
credential identifier

Specified by:
  `type` in interface `CredentialPlugin`
Returns:
  type

### initialize

public CredentialPlugin initialize(Configuration conf, String userName, HostAddress hostAddress)
Description copied from interface: `CredentialPlugin`
Permit initializing plugin if overridden

Specified by:
  `initialize` in interface `CredentialPlugin`
Parameters:
  `conf` - configuration
  `userName` - user
  `hostAddress` - host information
Returns:
  credential plugin

### get

public Credential get()

Specified by:
  `get` in interface `Supplier<Credential>`