Interface AuthenticationStrategy
- 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 TypeMethodDescriptionvoidapplyAuthentication(org.springframework.http.HttpHeaders headers) Applies authentication information to the provided HTTP headers.booleanisValid()Checks if the current authentication is valid.voidRefreshes the authentication if needed.
-
Method Details
-
applyAuthentication
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
Refreshes the authentication if needed. This method should be called before using the authentication if isValid() returns false.- Throws:
DAValidateException- if authentication refresh fails
-