Class ServiceAuthenticator
java.lang.Object
ai.wanaku.cli.main.support.security.ServiceAuthenticator
Handles OAuth2 authentication with the Wanaku.
Manages access tokens, refresh tokens, and automatic token renewal.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new authenticator and obtains an initial access token. -
Method Summary
Modifier and TypeMethodDescriptionReturns a valid access token, renewing it if necessary.Formats the access token as an Authorization header value.
-
Constructor Details
-
ServiceAuthenticator
Creates a new authenticator and obtains an initial access token.- Parameters:
config- The security service configuration containing OAuth2 credentials.
-
-
Method Details
-
currentValidAccessToken
Returns a valid access token, renewing it if necessary.- Returns:
- A valid access token value.
-
currentValidRefreshToken
-
toHeaderValue
Formats the access token as an Authorization header value.- Returns:
- The formatted Bearer token header value.
-