googleapis / googleapis/google-cloud-java

[google-auth-library-java] ServiceAccountCredentials with SSJ flow will get error when invoking refreshAccessToken()

Open
#12,591 0 comments 0 reactions 0 assignees View on GitHub
priority: p4 type: bug
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

[refreshAccessToke()](https://github.com/googleapis/google-auth-library-java/blob/89201558db913d9a71b3acccbab8eb0045ada6de/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java#L496) posts request to OAuth2 token server (see [code](https://github.com/googleapis/google-auth-library-java/blob/89201558db913d9a71b3acccbab8eb0045ada6de/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java#L507)).
This code path is not exercised for TPC flow via getRequestMetadata(), but it is an public method and is possible to accidentally get triggered by customer's code.

One invocation within this library (that we are patching in googleapis/google-auth-library-java#1528 ) is [here](https://github.com/googleapis/google-auth-library-java/blob/89201558db913d9a71b3acccbab8eb0045ada6de/oauth2_http/java/com/google/auth/oauth2/ImpersonatedCredentials.java#L493)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.