org.apache.http.impl.auth.win

## Class WindowsNegotiateScheme

- java.lang.Object
- - org.apache.http.impl.auth.AuthSchemeBase
  - - org.apache.http.impl.auth.win.WindowsNegotiateScheme

- All Implemented Interfaces:
    AuthScheme, ContextAwareAuthScheme

      public class WindowsNegotiateScheme
      extends AuthSchemeBase

  Auth scheme that makes use of JNA to implement Negotiate and NTLM on Windows Platforms.

  This will delegate negotiation to the windows machine.

  EXPERIMENTAL

  Since:
    4.4

- - ### Field Summary

    - ### Fields inherited from class org.apache.http.impl.auth.AuthSchemeBase

      `challengeState`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WindowsNegotiateScheme(String scheme, String servicePrincipalName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.http.Header` | `authenticate(Credentials credentials, org.apache.http.HttpRequest request)` Deprecated. Use `authenticate(Credentials, HttpRequest, HttpContext)`
    `org.apache.http.Header` | `authenticate(Credentials credentials, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)` Produces an authorization string for the given set of `Credentials`.
    `void` | `dispose()`
    `void` | `finalize()`
    `String` | `getParameter(String name)` Returns authentication parameter with the given name, if available.
    `String` | `getRealm()` Returns authentication realm.
    `String` | `getSchemeName()` Returns textual designation of the given authentication scheme.
    `boolean` | `isComplete()` Authentication process may involve a series of challenge-response exchanges.
    `boolean` | `isConnectionBased()` Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis
    `protected void` | `parseChallenge(org.apache.http.util.CharArrayBuffer buffer, int beginIndex, int endIndex)`

    - ### Methods inherited from class org.apache.http.impl.auth.AuthSchemeBase

      `getChallengeState, isProxy, processChallenge, toString`

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

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

- - ### Constructor Detail

    - #### WindowsNegotiateScheme

          public WindowsNegotiateScheme(String scheme,
                                String servicePrincipalName)

  - ### Method Detail

    - #### dispose

          public void dispose()

    - #### finalize

          public void finalize()
                        throws Throwable

      Overrides:
        `finalize` in class `Object`
      Throws:
        `Throwable`

    - #### getSchemeName

          public String getSchemeName()

      Description copied from interface: `AuthScheme`
      Returns textual designation of the given authentication scheme.
      Returns:
        the name of the given authentication scheme

    - #### getParameter

          public String getParameter(String name)

      Description copied from interface: `AuthScheme`
      Returns authentication parameter with the given name, if available.
      Parameters:
        `name` - The name of the parameter to be returned
      Returns:
        the parameter with the given name

    - #### getRealm

          public String getRealm()

      Description copied from interface: `AuthScheme`
      Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returns `null`.
      Returns:
        the authentication realm

    - #### isConnectionBased

          public boolean isConnectionBased()

      Description copied from interface: `AuthScheme`
      Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis
      Returns:
        `true` if the scheme is connection based, `false` if the scheme is request based.

    - #### parseChallenge

          protected void parseChallenge(org.apache.http.util.CharArrayBuffer buffer,
                            int beginIndex,
                            int endIndex)
                                 throws MalformedChallengeException

      Specified by:
        `parseChallenge` in class `AuthSchemeBase`
      Throws:
        `MalformedChallengeException`

    - #### authenticate

          public org.apache.http.Header authenticate(Credentials credentials,
                                            org.apache.http.HttpRequest request,
                                            org.apache.http.protocol.HttpContext context)
                                              throws AuthenticationException

      Description copied from interface: `ContextAwareAuthScheme`
      Produces an authorization string for the given set of `Credentials`.
      Specified by:
        `authenticate` in interface `ContextAwareAuthScheme`
      Overrides:
        `authenticate` in class `AuthSchemeBase`
      Parameters:
        `credentials` - The set of credentials to be used for athentication
        `request` - The request being authenticated
        `context` - HTTP context
      Returns:
        the authorization string
      Throws:
        `AuthenticationException` - if authorization string cannot be generated due to an authentication failure

    - #### isComplete

          public boolean isComplete()

      Description copied from interface: `AuthScheme`
      Authentication process may involve a series of challenge-response exchanges. This method tests if the authorization process has been completed, either successfully or unsuccessfully, that is, all the required authorization challenges have been processed in their entirety.
      Returns:
        `true` if the authentication process has been completed, `false` otherwise.

    - #### authenticate

          @Deprecated
          public org.apache.http.Header authenticate(Credentials credentials,
                                                       org.apache.http.HttpRequest request)
                                              throws AuthenticationException

      Deprecated. Use `authenticate(Credentials, HttpRequest, HttpContext)`
      Description copied from interface: `AuthScheme`
      Produces an authorization string for the given set of `Credentials`.
      Parameters:
        `credentials` - The set of credentials to be used for athentication
        `request` - The request being authenticated
      Returns:
        the authorization string
      Throws:
        `AuthenticationException` - if authorization string cannot be generated due to an authentication failure

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.