Skip to content

Commit 3bb2879

Browse files
authored
fix: Add warnings to users about using credentials from external sources (#2551)
1 parent 8b46efb commit 3bb2879

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ public static GoogleCredential getApplicationDefault(
199199
* {@link Beta} <br>
200200
* Return a credential defined by a Json file.
201201
*
202+
* <p>Important: If you accept a credential configuration (credential JSON/File/Stream) from an
203+
* external source for authentication to Google Cloud Platform, you must validate it before
204+
* providing it to any Google API or library. Providing an unvalidated credential configuration to
205+
* Google APIs can compromise the security of your systems and data. For more information, refer
206+
* to {@link <a
207+
* href="https://cloud.google.com/docs/authentication/external/externally-sourced-credentials">documentation</a>}.
208+
*
202209
* @param credentialStream the stream with the credential definition.
203210
* @return the credential defined by the credentialStream.
204211
* @throws IOException if the credential cannot be created from the stream.
@@ -212,6 +219,13 @@ public static GoogleCredential fromStream(InputStream credentialStream) throws I
212219
* {@link Beta} <br>
213220
* Return a credential defined by a Json file.
214221
*
222+
* <p>Important: If you accept a credential configuration (credential JSON/File/Stream) from an
223+
* external source for authentication to Google Cloud Platform, you must validate it before
224+
* providing it to any Google API or library. Providing an unvalidated credential configuration to
225+
* Google APIs can compromise the security of your systems and data. For more information, refer
226+
* to {@link <a
227+
* href="https://cloud.google.com/docs/authentication/external/externally-sourced-credentials">documentation</a>}.
228+
*
215229
* @param credentialStream the stream with the credential definition.
216230
* @param transport the transport for Http calls.
217231
* @param jsonFactory the factory for Json parsing and formatting.

0 commit comments

Comments
 (0)