diff --git a/sdk/vra_client.go b/sdk/vra_client.go index 3f897a6..9e22fa6 100644 --- a/sdk/vra_client.go +++ b/sdk/vra_client.go @@ -38,7 +38,9 @@ func (c *APIClient) DoRequest(req *APIRequest, login bool) (*APIResponse, error) return nil, err } if !login { - c.Authenticate() + if c.BearerToken == "" { + c.Authenticate() + } r.Header.Add(AuthorizationHeader, c.BearerToken) } r.Header.Add(ConnectionHeader, CloseConnection)