Index: remoting/client/plugin/chromoting_scriptable_object.cc |
=================================================================== |
--- remoting/client/plugin/chromoting_scriptable_object.cc (revision 139575) |
+++ remoting/client/plugin/chromoting_scriptable_object.cc (working copy) |
@@ -390,22 +390,31 @@ |
} |
config.shared_secret = args[arg++].AsString(); |
- if (!args[arg].is_string()) { |
- *exception = Var("The authentication_methods must be a string."); |
- return Var(); |
- } |
+ // Older versions of the webapp do not supply the following two |
+ // parameters. |
- if (!ChromotingInstance::ParseAuthMethods( |
- args[arg++].AsString(), &config)) { |
- *exception = Var("No valid authentication methods specified."); |
- return Var(); |
+ // By default use V1 authentication. |
+ config.use_v1_authenticator = true; |
+ if (args.size() > arg) { |
+ if (!args[arg].is_string()) { |
+ *exception = Var("The authentication_methods must be a string."); |
+ return Var(); |
+ } |
+ |
+ if (!ChromotingInstance::ParseAuthMethods( |
+ args[arg++].AsString(), &config)) { |
+ *exception = Var("No valid authentication methods specified."); |
+ return Var(); |
+ } |
} |
- if (!args[arg].is_string()) { |
- *exception = Var("The authentication_tag must be a string."); |
- return Var(); |
+ if (args.size() > arg) { |
+ if (!args[arg].is_string()) { |
+ *exception = Var("The authentication_tag must be a string."); |
+ return Var(); |
+ } |
+ config.authentication_tag = args[arg++].AsString(); |
} |
- config.authentication_tag = args[arg++].AsString(); |
if (args.size() != arg) { |
*exception = Var("Too many agruments passed to connect()."); |