Skip to content

Commit 7f1707c

Browse files
authored
Add documentation note that getAccessToken() returns cached value (#162)
1 parent 37d65d2 commit 7f1707c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/OAuth2Credentials.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import com.google.auth.http.AuthHttpConstants;
3838
import com.google.common.annotations.VisibleForTesting;
3939
import com.google.common.base.MoreObjects;
40-
import com.google.common.base.MoreObjects.ToStringHelper;
4140
import com.google.common.base.Preconditions;
4241
import com.google.common.collect.Iterables;
4342

@@ -131,6 +130,11 @@ public boolean hasRequestMetadataOnly() {
131130
return true;
132131
}
133132

133+
/**
134+
* Returns the cached access token.
135+
*
136+
* <p>If not set, you should call {@link #refresh()} to fetch and cache an access token.</p>
137+
*/
134138
public final AccessToken getAccessToken() {
135139
return temporaryAccess;
136140
}

0 commit comments

Comments
 (0)