org.apache.hc.client5.http.impl.auth

## Class SystemDefaultCredentialsProvider

- java.lang.Object
- - org.apache.hc.client5.http.impl.auth.SystemDefaultCredentialsProvider

- All Implemented Interfaces:
    CredentialsProvider, CredentialsStore

      @Contract(threading=SAFE)
      public class SystemDefaultCredentialsProvider
      extends Object
      implements CredentialsStore

  Implementation of `CredentialsStore` backed by standard JRE `Authenticator`.
  Since:
    4.3

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SystemDefaultCredentialsProvider()` Default constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears all credentials.
    `Credentials` | `getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext context)` Returns `credentials` for the given authentication scope, if available.
    `void` | `setCredentials(AuthScope authScope, Credentials credentials)` Sets the `credentials` for the given authentication scope.

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

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

- - ### Constructor Detail

    - #### SystemDefaultCredentialsProvider

          public SystemDefaultCredentialsProvider()

      Default constructor.

  - ### Method Detail

    - #### setCredentials

          public void setCredentials(AuthScope authScope,
                            Credentials credentials)

      Description copied from interface: `CredentialsStore`
      Sets the `credentials` for the given authentication scope. Any previous credentials for the given scope will be overwritten.
      Specified by:
        `setCredentials` in interface `CredentialsStore`
      Parameters:
        `authScope` - the `authentication scope`
        `credentials` - the authentication `credentials` for the given scope.
      See Also:
        `CredentialsProvider.getCredentials(AuthScope, org.apache.hc.core5.http.protocol.HttpContext)`

    - #### getCredentials

          public Credentials getCredentials(AuthScope authScope,
                                   org.apache.hc.core5.http.protocol.HttpContext context)

      Description copied from interface: `CredentialsProvider`
      Returns `credentials` for the given authentication scope, if available.
      Specified by:
        `getCredentials` in interface `CredentialsProvider`
      Parameters:
        `authScope` - the `authentication scope`
        `context` - the `http context`
      Returns:
        the credentials

    - #### clear

          public void clear()

      Description copied from interface: `CredentialsStore`
      Clears all credentials.
      Specified by:
        `clear` in interface `CredentialsStore`

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