org.apache.hc.client5.http

## Interface AuthenticationStrategy

- All Known Implementing Classes:
    DefaultAuthenticationStrategy

      @Contract(threading=STATELESS)
      public interface AuthenticationStrategy

  Strategy to select auth schemes in order of preference based on auth challenges presented by the opposite endpoint (target server or a proxy).

  Implementations of this interface must be thread-safe. Access to shared data must be synchronized as methods of this interface may be executed from multiple threads.

  Since:
    4.2

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<AuthScheme>` | `select(ChallengeType challengeType, Map<String,AuthChallenge> challenges, org.apache.hc.core5.http.protocol.HttpContext context)` Returns an list of `AuthScheme`s to handle the given `AuthChallenge`s in their order of preference.

- - ### Method Detail

    - #### select

          List<AuthScheme> select(ChallengeType challengeType,
                                Map<String,AuthChallenge> challenges,
                                org.apache.hc.core5.http.protocol.HttpContext context)

      Returns an list of `AuthScheme`s to handle the given `AuthChallenge`s in their order of preference.
      Parameters:
        `challengeType` - challenge type.
        `challenges` - map of challenges keyed by lowercase auth scheme names.
        `context` - HTTP context.
      Returns:
        authentication auth schemes that can be used for authentication. Can be empty.
      Since:
        5.0

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