Skip to content

Commit

Permalink
remoting: Update OAuth scopes for Android app.
Browse files Browse the repository at this point in the history
The gRPC directory API use chromoting.directory instead of chromoting,
and FTL signaling requires an additional scope.

Change-Id: Ifbe3fe32fc30bbd94b71cac46810ebbfd77160cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1603769
Commit-Queue: Erik Jensen <rkjnsn@chromium.org>
Reviewed-by: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658338}
  • Loading branch information
Erik Jensen authored and Commit Bot committed May 9, 2019
1 parent 50ccb9f commit 4744783
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ public class Chromoting extends AppCompatActivity
private static final String ACCOUNT_TYPE = "com.google";

/** Scope to use when fetching the OAuth token. */
private static final String TOKEN_SCOPE = "oauth2:https://www.googleapis.com/auth/chromoting "
// To use these scopes in a debug build, your development account will need to be whitelisted.
private static final String TOKEN_SCOPE =
"oauth2:https://www.googleapis.com/auth/chromoting.directory "
+ "https://www.googleapis.com/auth/tachyon "
+ "https://www.googleapis.com/auth/googletalk";

/** Result code used for starting {@link DesktopActivity}. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
@JNINamespace("remoting")
public class JniOAuthTokenGetter {
private static final String TAG = "Chromoting";
private static final String TOKEN_SCOPE = "oauth2:https://www.googleapis.com/auth/chromoting";
// Note: Any scope requested here must also be requested in Chromoting.java. (I.e., this must be
// a subset of Chromoting.java's TOKEN_SCOPE.) This is because the context passed to
// OAuthTokenFetcher below is not an activity, and thus it will not be possible to show a
// consent page requesting new scopes.
private static final String TOKEN_SCOPE =
"oauth2:https://www.googleapis.com/auth/chromoting.directory "
+ "https://www.googleapis.com/auth/tachyon";

private static String sAccount;
private static String sLatestToken;
Expand Down

0 comments on commit 4744783

Please sign in to comment.