Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request #602

Open
mahichachra opened this issue Jan 24, 2021 · 3 comments
Labels
type: question Request for information or clarification. Not an issue.

Comments

@mahichachra
Copy link

getting this error

Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
POST https://oauth2.googleapis.com/token
{
"error" : "invalid_scope",
"error_description" : "Invalid OAuth scope or ID token audience provided."
}
at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:326)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:346)

Code snippet
public static Compute createComputeService() throws IOException, GeneralSecurityException {
logger.info("Entered createComputeService");
HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
GoogleCredential credentials = GoogleCredential.getApplicationDefault();
return new Compute.Builder(httpTransport, jsonFactory, credentials)
.setApplicationName("Google-xyz/0.1")
.build();
}

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 25, 2021
@Neenu1995 Neenu1995 added the type: question Request for information or clarification. Not an issue. label Jan 25, 2021
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Jan 25, 2021
@jbhushan791
Copy link

Is it resoved?

@jbhushan791
Copy link

It got resolved by setting scope

@roma2341
Copy link

roma2341 commented Apr 8, 2023

It got resolved by setting scope

what scope ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

5 participants