private String getNegotiateToken ( ) throws GSSException { if ( spnegoNegotiator == null ) { throw new IllegalStateException ( "Negotiator not yet initialized." ) ; } // Perform GSS Dance String authString ; if ( StringUtils . hasText ( challenge ) ) { authString = spnegoNegotiator . send ( challenge ) ; } else { authString = spnegoNegotiator . send ( ) ; } this . challenge = null ; // Prepend the authentication scheme to use if ( authString != null ) { authString = EsHadoopAuthPolicies . NEGOTIATE + " " + authString ; } return authString ; }
Attempts to retrieve the next negotiation token to send consuming any previously set challenge data .