diff --git a/auth.go b/auth.go index 916e8c1..dc5ec84 100644 --- a/auth.go +++ b/auth.go @@ -27,6 +27,7 @@ type KubernetesAuthLoginOptions struct { type AuthInterface interface { SetAccessToken(accessToken string) + GetAccessToken() string UniversalAuthLogin(clientID string, clientSecret string) (credential MachineIdentityCredential, err error) KubernetesAuthLogin(identityID string, serviceAccountTokenPath string) (credential MachineIdentityCredential, err error) KubernetesRawServiceAccountTokenLogin(identityID string, serviceAccountToken string) (credential MachineIdentityCredential, err error) @@ -45,6 +46,10 @@ func (a *Auth) SetAccessToken(accessToken string) { a.client.setPlainAccessToken(accessToken) } +func (a *Auth) GetAccessToken() string { + return a.client.tokenDetails.AccessToken +} + func (a *Auth) UniversalAuthLogin(clientID string, clientSecret string) (credential MachineIdentityCredential, err error) { if clientID == "" {