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

Unified Diff: remoting/webapp/base/js/credentials_provider.js

Issue 1397463003: Report the Auth method for me2me connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: remoting/webapp/base/js/credentials_provider.js
diff --git a/remoting/webapp/base/js/credentials_provider.js b/remoting/webapp/base/js/credentials_provider.js
index 7818f816b69eb00fe65dde8a026b463a30331426..01959912e314d357b6a8273a46cdf162691041ea 100644
--- a/remoting/webapp/base/js/credentials_provider.js
+++ b/remoting/webapp/base/js/credentials_provider.js
@@ -50,16 +50,23 @@ remoting.CredentialsProvider = function(args) {
this.accessCode_ = args.accessCode;
/** @private */
this.fetchThirdPartyToken_ = args.fetchThirdPartyToken;
+
+ /** @private {?remoting.ChromotingEvent.AuthMethod} */
+ this.authMethod_ = null;
};
/** @returns {void} */
remoting.CredentialsProvider.prototype.getAccessCode_ = function(
/** boolean */ supportsPairing, /** Function */ callback) {
+ this.authMethod_ = remoting.ChromotingEvent.AuthMethod.ACCESS_CODE;
Jamie 2015/10/08 22:22:42 This isn't the right place to set this. Aside from
kelvinp 2015/10/09 00:45:41 I agree that the correct long term fix will be in
Jamie 2015/10/09 01:17:21 Agreed, thanks for investigating.
kelvinp 2015/10/09 18:00:34 Done.
callback(this.accessCode_);
};
/** @returns {remoting.PairingInfo} */
remoting.CredentialsProvider.prototype.getPairingInfo = function() {
+ if (this.pairingInfo_) {
+ this.authMethod_ = remoting.ChromotingEvent.AuthMethod.PINLESS;
+ }
return this.pairingInfo_ || { clientId: '', sharedSecret: ''};
};
@@ -72,6 +79,8 @@ remoting.CredentialsProvider.prototype.getPIN = function(pairingSupported) {
if (!this.fetchPin_) {
Promise.resolve('');
}
+
+ this.authMethod_ = remoting.ChromotingEvent.AuthMethod.PIN;
return new Promise(function(/** function(string) */ resolve) {
that.fetchPin_(pairingSupported, resolve);
});
@@ -90,6 +99,8 @@ remoting.CredentialsProvider.prototype.getThirdPartyToken = function(
if (!this.fetchThirdPartyToken_) {
Promise.resolve({token: '', secret: ''});
}
+
+ this.authMethod_ = remoting.ChromotingEvent.AuthMethod.THIRD_PARTY;
return new Promise(function(/** Function */ resolve) {
var onTokenFetched = function(/** string */ token, /** string */ secret) {
resolve({token: token, secret: secret});
@@ -97,3 +108,8 @@ remoting.CredentialsProvider.prototype.getThirdPartyToken = function(
that.fetchThirdPartyToken_(tokenUrl, hostPublicKey, scope, onTokenFetched);
});
};
+
+/** @return {?remoting.ChromotingEvent.AuthMethod} */
+remoting.CredentialsProvider.prototype.getAuthMethod = function() {
+ return this.authMethod_;
+};

Powered by Google App Engine
This is Rietveld 408576698