Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Unified Diff: remoting/webapp/crd/js/identity.js

Issue 1015343002: Downscope tokens before sending them to app-remoting host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/identity.js
diff --git a/remoting/webapp/crd/js/identity.js b/remoting/webapp/crd/js/identity.js
index 742a552d6bb29825fe19d37d0fcf8e71e9515ea3..d53a0395d010e372a7eaf4ffc22a0dfa284fd7db 100644
--- a/remoting/webapp/crd/js/identity.js
+++ b/remoting/webapp/crd/js/identity.js
@@ -83,14 +83,16 @@ remoting.Identity.prototype.getToken = function(opt_scopes) {
/**
* Gets a fresh access token.
*
+ * @param {Array<string>=} opt_scopes Optional OAuth2 scopes to request, as
+ * documented in getToken().
* @return {!Promise<string>} A promise resolved with an access token
* or rejected with a remoting.Error.
*/
-remoting.Identity.prototype.getNewToken = function() {
+remoting.Identity.prototype.getNewToken = function(opt_scopes) {
/** @type {remoting.Identity} */
var that = this;
- return this.getToken().then(function(/** string */ token) {
+ return this.getToken(opt_scopes).then(function(/** string */ token) {
return new Promise(function(resolve, reject) {
chrome.identity.removeCachedAuthToken({'token': token }, function() {
resolve(that.getToken());
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698