Skip to content

Commit

Permalink
Fixing invalid_scope: Invalid OAuth scope or ID token audience provid…
Browse files Browse the repository at this point in the history
…ed (#618)
  • Loading branch information
kubmichael authored Dec 2, 2024
1 parent b33d7b6 commit 6568ca6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@

def _get_token(credentials: Optional[Credentials] = None) -> str:
"""Returns a valid token for GCP auth."""
credentials = auth.default()[0] if not credentials else credentials
credentials = (
auth.default(scopes=["https://www.googleapis.com/auth/cloud-platform"])[0]
if not credentials
else credentials
)
request = auth_requests.Request()
credentials.refresh(request)
if not credentials.token:
Expand Down

0 comments on commit 6568ca6

Please sign in to comment.