Interface IAuthClient
- All Known Implementing Classes:
AuthClient
public interface IAuthClient
Interface defining the contract for an authentication client.
An implementation of this interface provides methods to retrieve access tokens
and service URLs by interacting with a service's authentication mechanism.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the current access token.Retrieves a new access token using the stored service key.getNewAccessToken
(ServiceKey serviceKey) Retrieves a new access token using the provided service key.Retrieves the service URL from the stored service key.
-
Method Details
-
getAccessToken
Retrieves the current access token. If the token is valid, it returns the cached token; otherwise, it fetches a new token.- Returns:
- the access token as a
String
- Throws:
IOException
- if an I/O error occursInterruptedException
- if the operation is interrupted
-
getNewAccessToken
Retrieves a new access token using the stored service key.- Returns:
- the new access token as a
String
- Throws:
IOException
- if an I/O error occursInterruptedException
- if the operation is interrupted
-
getNewAccessToken
Retrieves a new access token using the provided service key.- Parameters:
serviceKey
- theServiceKey
used for authentication- Returns:
- the new access token as a
String
- Throws:
IOException
- if an I/O error occursInterruptedException
- if the operation is interrupted
-
getServiceUrl
String getServiceUrl()Retrieves the service URL from the stored service key.- Returns:
- the service URL as a
String
-