@ Override public void continueSSPI ( int msgLength ) throws SQLException , IOException { if ( sspiContext == null ) { throw new IllegalStateException ( "Cannot continue SSPI authentication that we didn't begin" ) ; } LOGGER . log ( Level . FINEST , "Continuing SSPI negotiation" ) ; /* Read the response token from the server */ byte [ ] receivedToken = pgStream . receive ( msgLength ) ; SecBufferDesc continueToken = new SecBufferDesc ( Sspi . SECBUFFER_TOKEN , receivedToken ) ; sspiContext . initialize ( sspiContext . getHandle ( ) , continueToken , targetName ) ; /* * Now send the response token. If negotiation is complete there may be zero bytes to send, in * which case we shouldn't send a reply as the server is not expecting one; see fe-auth.c in * libpq for details. */ byte [ ] responseToken = sspiContext . getToken ( ) ; if ( responseToken . length > 0 ) { sendSSPIResponse ( responseToken ) ; LOGGER . log ( Level . FINEST , "Sent SSPI negotiation continuation message" ) ; } else { LOGGER . log ( Level . FINEST , "SSPI authentication complete, no reply required" ) ; } }
Continue an existing authentication conversation with the back - end in resonse to an authentication request of type AUTH_REQ_GSS_CONT .