Compartir vía


AzurePostgresqlAuthenticationPlugin Class

  • java.lang.Object
    • com.azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin

Implements

org.postgresql.plugin.AuthenticationPlugin

public class AzurePostgresqlAuthenticationPlugin
implements org.postgresql.plugin.AuthenticationPlugin

The authentication plugin that enables authentication with Microsoft Entra ID.

Constructor Summary

Constructor Description
AzurePostgresqlAuthenticationPlugin(Properties properties)

Constructor with properties.

Method Summary

Modifier and Type Method and Description
char[] getPassword(AuthenticationRequestType type)

Callback method to provide the password to use for authentication.

Methods inherited from java.lang.Object

Constructor Details

AzurePostgresqlAuthenticationPlugin

public AzurePostgresqlAuthenticationPlugin(Properties properties)

Constructor with properties.

Parameters:

properties - the properties.

Method Details

getPassword

public char[] getPassword(AuthenticationRequestType type)

Callback method to provide the password to use for authentication.

Parameters:

type - The authentication method that the server is requesting.
         <p>AzurePostgresqlAuthenticationPlugin is used as an extension to
         perform authentication with Microsoft Entra ID, the value here is CLEARTEXT_PASSWORD.</p>

         When PostgreSQL client trying to connect with PostgreSQL server:
         1. Client will send startup packet to server, the server will return the AuthenticationRequestType it accepts,
            If the username is used to perform Microsoft Entra authentication, the server will return CLEARTEXT_PASSWORD.
         2. Client will do authentication (until AuthenticationOk).

Returns:

The password to use.

Throws:

org.postgresql.util.PSQLException - It will return a PSQLException if the password is null.

Applies to