Skip to content

Commit 9c483ba

Browse files
authored
Overload GoogleCredentials.createScoped with variadic arguments (#218)
* Add variadic overload of GoogleCredentials.createScoped * Remove unused import
1 parent 5d72d3b commit 9c483ba

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,17 @@ public GoogleCredentials createScoped(Collection<String> scopes) {
227227
return this;
228228
}
229229

230+
/**
231+
* If the credentials support scopes, creates a copy of the the identity with the specified
232+
* scopes; otherwise, returns the same instance.
233+
*
234+
* @param scopes Collection of scopes to request.
235+
* @return GoogleCredentials with requested scopes.
236+
*/
237+
public GoogleCredentials createScoped(String... scopes) {
238+
return createScoped(scopes);
239+
}
240+
230241
/**
231242
* If the credentials support domain-wide delegation, creates a copy
232243
* of the identity so that it impersonates the specified user;

0 commit comments

Comments
 (0)