Interface AuthSession

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
DefaultAuthSession
All Known Implementing Classes:
OAuth2Util.AuthSession, RESTSigV4AuthSession

public interface AuthSession extends AutoCloseable
An authentication session that can be used to authenticate outgoing HTTP requests.

Authentication sessions are usually immutable, but may hold resources that need to be released when the session is no longer needed. Implementations should override close() to release any resources.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final AuthSession
    An empty session that does nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    Authenticates the given request and returns a new request with the necessary authentication.
    void
    Closes the session and releases any resources.
  • Field Details

    • EMPTY

      static final AuthSession EMPTY
      An empty session that does nothing.
  • Method Details

    • authenticate

      HTTPRequest authenticate(HTTPRequest request)
      Authenticates the given request and returns a new request with the necessary authentication.
    • close

      void close()
      Closes the session and releases any resources. This method is called when the session is no longer needed. Note that since sessions may be cached, this method may not be called immediately after the session is no longer needed, but rather when the session is evicted from the cache, or the cache itself is closed.
      Specified by:
      close in interface AutoCloseable