Use Waffle-JNI to support SSPI authentication when PgJDBC is running on a Windows client and talking to a Windows server.
SSPI is not supported on a non-Windows client.
| Modifier and Type | Field and Description |
|---|---|
| private @Nullable IWindowsCredentialsHandle | |
| private final boolean | |
| private static final Logger | |
| private final PGStream | |
| private static final Constructor | |
| private final String | |
| public static final String | |
| private @Nullable WindowsSecurityContextImpl | |
| private @Nullable String |
| Access | Constructor and Description |
|---|---|
| public | SSPIClient(PGStream
PostgreSQL connection stream pgStream, String SSPI SPN service class, defaults to POSTGRES if null spnServiceClass, boolean enable negotiate enableNegotiate)Instantiate an SSPIClient for authentication of a connection. |
| Modifier and Type | Method and Description |
|---|---|
| public void | continueSSPI(int
Length of message to read, excluding length word and message type word msgLength)Implements org. Continue an existing authentication conversation with the back-end in response to an authentication request of type AUTH_REQ_GSS_CONT. |
| public void | dispose()
Implements org. Clean up native win32 resources after completion or failure of SSPI authentication. |
| public boolean | Returns: true if it's safe to attempt SSPI authenticationImplements org. Test whether we can attempt SSPI authentication. |
| private String | |
| private void | |
| public void | startSSPI()
Implements org. Respond to an authentication request from the back-end for SSPI authentication (AUTH_REQ_SSPI). |
| clientCredentials | back to summary |
|---|---|
| private @Nullable IWindowsCredentialsHandle clientCredentials | |
| enableNegotiate | back to summary |
|---|---|
| private final boolean enableNegotiate | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| pgStream | back to summary |
|---|---|
| private final PGStream pgStream | |
| SEC_BUFFER_DESC_FACTORY | back to summary |
|---|---|
| private static final Constructor<? extends Sspi. | |
| spnServiceClass | back to summary |
|---|---|
| private final String spnServiceClass | |
| SSPI_DEFAULT_SPN_SERVICE_CLASS | back to summary |
|---|---|
| public static final String SSPI_DEFAULT_SPN_SERVICE_CLASS | |
| sspiContext | back to summary |
|---|---|
| private @Nullable WindowsSecurityContextImpl sspiContext | |
| targetName | back to summary |
|---|---|
| private @Nullable String targetName | |
| SSPIClient | back to summary |
|---|---|
| public SSPIClient(PGStream pgStream, String spnServiceClass, boolean enableNegotiate) Instantiate an SSPIClient for authentication of a connection. SSPIClient is not re-usable across connections. It is safe to instantiate SSPIClient even if Waffle and JNA are missing or on non-Windows platforms, however you may not call any methods other than isSSPISupported(). | |
| continueSSPI | back to summary |
|---|---|
| public void continueSSPI(int msgLength) throws SQLException, IOException Implements org. Continue an existing authentication conversation with the back-end in response to an authentication request of type AUTH_REQ_GSS_CONT.
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements org. Clean up native win32 resources after completion or failure of SSPI authentication. This SSPIClient instance becomes unusable after disposal.
| |
| isSSPISupported | back to summary |
|---|---|
| public boolean isSSPISupported() Implements org. Test whether we can attempt SSPI authentication. If false, do not attempt to call any other SSPIClient methods.
| |
| makeSPN | back to summary |
|---|---|
| private String makeSPN() throws PSQLException | |
| sendSSPIResponse | back to summary |
|---|---|
| private void sendSSPIResponse(byte[] outToken) throws IOException | |
| startSSPI | back to summary |
|---|---|
| public void startSSPI() throws SQLException, IOException Implements org. Respond to an authentication request from the back-end for SSPI authentication (AUTH_REQ_SSPI).
| |