org.apache.http.impl.auth.win

## Class CurrentWindowsCredentials

- java.lang.Object
- - org.apache.http.impl.auth.win.CurrentWindowsCredentials

- All Implemented Interfaces:
    Serializable, Principal, Credentials

      @Contract(threading=IMMUTABLE)
      public final class CurrentWindowsCredentials
      extends Object
      implements Credentials, Serializable, Principal

  Returns the current Windows user credentials

  EXPERIMENTAL

  Since:
    4.4
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static CurrentWindowsCredentials` | `INSTANCE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `static String` | `getCurrentUsername()` Get the SAM-compatible username of the currently logged-on user.
    `String` | `getName()`
    `String` | `getPassword()` Returns an empty password
    `Principal` | `getUserPrincipal()`
    `int` | `hashCode()`
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final CurrentWindowsCredentials INSTANCE

  - ### Method Detail

    - #### getCurrentUsername

          public static String getCurrentUsername()

      Get the SAM-compatible username of the currently logged-on user.
      Returns:
        String.

    - #### getUserPrincipal

          public Principal getUserPrincipal()

      Specified by:
        `getUserPrincipal` in interface `Credentials`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Principal`
      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Specified by:
        `equals` in interface `Principal`
      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Specified by:
        `toString` in interface `Principal`
      Overrides:
        `toString` in class `Object`

    - #### getPassword

          public String getPassword()

      Returns an empty password
      Specified by:
        `getPassword` in interface `Credentials`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `Principal`

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