All Known Implementing Classes:
ApiTokenAuthentication, BasicAuthentication

public interface AuthenticationStrategy
Interface for authentication strategies. Implementations of this interface provide different methods of authentication for API requests.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyAuthentication(org.springframework.http.HttpHeaders headers)
    Applies authentication information to the provided HTTP headers.
    boolean
    Checks if the current authentication is valid.
    void
    Refreshes the authentication if needed.
  • Method Details

    • applyAuthentication

      void applyAuthentication(org.springframework.http.HttpHeaders headers) throws DAValidateException
      Applies authentication information to the provided HTTP headers.
      Parameters:
      headers - The HTTP headers to which authentication information should be added
      Throws:
      DAValidateException - if authentication fails
    • isValid

      boolean isValid()
      Checks if the current authentication is valid.
      Returns:
      true if the authentication is valid, false otherwise
    • refreshAuthentication

      void refreshAuthentication() throws DAValidateException
      Refreshes the authentication if needed. This method should be called before using the authentication if isValid() returns false.
      Throws:
      DAValidateException - if authentication refresh fails