Skip to content

How to override token_uri in service account credentials? #3001

@jlestel

Description

@jlestel

Hi,

I'm using the Google.Apis.Auth and PubSub library with a service account JSON key.

I would like to override the default token_uri (which is https://oauth2.googleapis.com/token) to use a custom OAuth endpoint.

In the JSON file, I changed the token_uri field to my custom endpoint: http://oauth2-myglobalpsc.p.googleapis.com

When I load the credentials using GoogleCredential.FromFile(...), I can see that the token_uri field is correctly set in the parsed ServiceAccountCredential.Initializer. However, the library still calls https://oauth2.googleapis.com/token when requesting the token.

Is there a supported way to make the library use the custom token_uri specified in the JSON file? Or another way to customize the token_uri?

Thanks!

Metadata

Metadata

Assignees

Labels

needs more infoThis issue needs more information from the customer to proceed.priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions