Top Description Fields Constructors Methods
com.mysql.cj.callback

public Class OpenidConnectAuthenticationCallback

extends Object
implements MysqlCallback
Class Inheritance
All Implemented Interfaces
com.mysql.cj.callback.MysqlCallback
Imports
java.util.function.Function, com.mysql.cj.conf.PropertyKey

The callback object used by the authentication plugin AuthenticationOpenidConnectClient to let the client application supply Identity Tokens to the driver. In OpenID, user authentication is outsourced to an IdP. This Callback is required to trigger some sort of user interaction by performing a login into an external system at the time the connection is established but not prior to it, because the success of the authentication depends on the MySQL user being authenticated and how the user was created on the MySQL Server.

Field Summary

Modifier and TypeField and Description
pack-priv Function<PropertyKey, String>
private byte[]
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the value of the specified PropertyKey as a String.
getConnProperty
(PropertyKey
a PropertyKey element.
propKey
)

Provides access to the connection properties where this authentication is being performed.

public byte[]

Returns:

the OpenID Identity Token.
getIdentityToken
()

Returns the OpenID Identity Token.

public String

Returns:

the user name.
getUser
()

Returns the user name.

public void
setIdentityToken(byte[]
the OpenID Identity Token.
identityToken
)

Sets the OpenID Identity Token.

public void
setUser(String
the user name.
user
)

Sets the user name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connPropSupplierback to summary
pack-priv Function<PropertyKey, String> connPropSupplier
identityTokenback to summary
private byte[] identityToken
userback to summary
private String user

Constructor Detail

OpenidConnectAuthenticationCallbackback to summary
public OpenidConnectAuthenticationCallback(Function<PropertyKey, String> connPropSupplier)

Method Detail

getConnPropertyback to summary
public String getConnProperty(PropertyKey propKey)

Provides access to the connection properties where this authentication is being performed.

Parameters
propKey:PropertyKey

a PropertyKey element.

Returns:String

the value of the specified PropertyKey as a String.

getIdentityTokenback to summary
public byte[] getIdentityToken()

Returns the OpenID Identity Token.

Returns:byte[]

the OpenID Identity Token.

getUserback to summary
public String getUser()

Returns the user name.

Returns:String

the user name.

setIdentityTokenback to summary
public void setIdentityToken(byte[] identityToken)

Sets the OpenID Identity Token.

Parameters
identityToken:byte[]

the OpenID Identity Token.

setUserback to summary
public void setUser(String user)

Sets the user name.

Parameters
user:String

the user name.