com.mysql.cj.callback

## Class OpenidConnectAuthenticationCallback

- java.lang.Object
- - com.mysql.cj.callback.OpenidConnectAuthenticationCallback

All Implemented Interfaces:
  MysqlCallback

    public class OpenidConnectAuthenticationCallback
    extends Object
    implements MysqlCallback

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

Fields
`(package private) Function<PropertyKey,String>` `connPropSupplier`
`private byte[]` `identityToken`
`private String` `user`

### Constructor Summary

Constructors
`OpenidConnectAuthenticationCallback(Function<PropertyKey,String> connPropSupplier)`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getConnProperty(PropertyKey propKey)` Provides access to the connection properties where this authentication is being performed.
`byte[]` `getIdentityToken()` Returns the OpenID Identity Token.
`String` `getUser()` Returns the user name.
`void` `setIdentityToken(byte[] identityToken)` Sets the OpenID Identity Token.
`void` `setUser(String user)` Sets the user name.

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

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

### Field Detail

#### user

    private String user

#### connPropSupplier

    Function<PropertyKey,String> connPropSupplier

#### identityToken

    private byte[] identityToken

### Constructor Detail

#### OpenidConnectAuthenticationCallback

    public OpenidConnectAuthenticationCallback(Function<PropertyKey,String> connPropSupplier)

### Method Detail

#### getConnProperty

    public String getConnProperty(PropertyKey propKey)

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

Parameters:
  `propKey` - a `PropertyKey` element.
Returns:
  the value of the specified `PropertyKey` as a String.

#### getUser

    public String getUser()

Returns the user name.

Returns:
  the user name.

#### setUser

    public void setUser(String user)

Sets the user name.

Parameters:
  `user` - the user name.

#### getIdentityToken

    public byte[] getIdentityToken()

Returns the OpenID Identity Token.

Returns:
  the OpenID Identity Token.

#### setIdentityToken

    public void setIdentityToken(byte[] identityToken)

Sets the OpenID Identity Token.

Parameters:
  `identityToken` - the OpenID Identity Token.

Copyright © 2016, 2025, Oracle and/or its affiliates.