Changeset 1533544
- Timestamp:
- 11/14/2016 08:36:19 AM (8 years ago)
- Location:
- openotp-authentication/trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
openotp-authentication/trunk/openotp.class.php
r1498033 r1533544 1 1 <?php 2 2 /* 3 RCDevs OpenOTP Plugin for RoundCube Webmail v2.04 Copyright (c) 2010-201 2RCDevs, All rights reserved.3 RCDevs OpenOTP Plugin for Wordpress 4-6 4 Copyright (c) 2010-2016 RCDevs, All rights reserved. 5 5 6 6 This program is free software; you can redistribute it and/or … … 201 201 $options['stream_context'] = $stream_context; 202 202 } 203 204 $soap_client = new SoapClientTimeout(dirname(__FILE__).'/openotp.wsdl', $options); 203 204 try{ 205 $soap_client = new SoapClientTimeout(dirname(__FILE__).'/openotp.wsdl', $options); 206 }catch(exception $e){ 207 $excpetion = $e->getMessage(); 208 return false; 209 } 205 210 if (!$soap_client) { 206 211 return false; 207 212 } 208 213 $soap_client->setTimeout(30); 214 $soap_client->setVersion(2); 209 215 $this->soap_client = $soap_client; 210 216 return true; … … 228 234 class SoapClientTimeout extends SoapClient { 229 235 private $timeout; 236 private $version; 230 237 231 238 public function setTimeout ($timeout) { 232 239 $this->timeout = $timeout; 240 } 241 public function setVersion ($version) { 242 $this->version = $version; 233 243 } 234 244 … … 246 256 curl_setopt($curl, CURLOPT_POSTFIELDS, $request); 247 257 curl_setopt($curl, CURLOPT_HEADER, false); 248 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml" ));258 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml", "API-Version: ".strval($this->version))); 249 259 curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout); 250 260 … … 257 267 } 258 268 } 259 260 ?> -
openotp-authentication/trunk/openotp.js
r1498033 r1533544 88 88 var new_width = Math.round(c*div_width/base); 89 89 document.getElementById('div_orange').style.width=new_width+'px'; 90 91 if( document.getElementsByName('openotp_password') ){ 90 91 //if( document.getElementsByName('openotp_password')[0] === undefined ) alert("Fuck"); 92 93 if( document.getElementsByName('openotp_password')[0] !== undefined ){ 92 94 document.getElementsByName('openotp_password')[0].focus(); 93 95 } … … 135 137 var timer = setInterval(function() {count(); }, 1000); 136 138 137 138 if( otp_settings.openotp_u2fChallenge){ 139 if (/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())) { 140 u2f.sign([ JSON.parse(otp_settings.openotp_u2fChallenge)], function(response) { 141 document.getElementsByName('openotp_u2f')[0].value = JSON.stringify(response); 142 document.getElementById("openotpform").submit(); 143 }, otp_settings.openotp_timeout ); 139 if( otp_settings.openotp_u2fChallenge ){ 140 if (/chrome|chromium|firefox|opera/.test(navigator.userAgent.toLowerCase())) { 141 var u2f_request = JSON.parse(otp_settings.openotp_u2fChallenge); 142 var u2f_regkeys = []; 143 for (var i=0, len=u2f_request.keyHandles.length; i<len; i++) { 144 u2f_regkeys.push({version:u2f_request.version,keyHandle:u2f_request.keyHandles[i]}); 145 } 146 u2f.sign(u2f_request.appId, u2f_request.challenge, u2f_regkeys, function(response) { 147 document.getElementsByName('openotp_u2f')[0].value = JSON.stringify(response); 148 document.getElementById('openotpform').submit(); 149 }, otp_settings.openotp_timeout ); 144 150 } else { 145 151 var u2f_activate = document.getElementById('u2f_activate'); … … 162 168 163 169 164 -
openotp-authentication/trunk/openotp.wsdl
r1498033 r1533544 17 17 <part name="source" type="xsd:string"/> 18 18 <part name="settings" type="xsd:string"/> 19 <part name="options" type="xsd:string"/>20 <part name="context" type="xsd:string"/>21 19 </message> 22 20 … … 30 28 <part name="settings" type="xsd:string"/> 31 29 <part name="options" type="xsd:string"/> 32 <part name="context" type="xsd:string"/>33 30 </message> 34 31 35 32 <message name="openotpLoginResponse"> 36 33 <part name="code" type="xsd:integer"/> 34 <part name="error" type="xsd:string"/> 37 35 <part name="message" type="xsd:string"/> 38 36 <part name="session" type="xsd:string"/> … … 54 52 <message name="openotpChallengeResponse"> 55 53 <part name="code" type="xsd:integer"/> 54 <part name="error" type="xsd:string"/> 56 55 <part name="message" type="xsd:string"/> 57 56 <part name="data" type="xsd:string"/> … … 92 91 <operation name="openotpSimpleLogin"> 93 92 <soap:operation soapAction="openotpSimpleLogin"/> 94 <input><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>95 <output><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>93 <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 94 <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 96 95 </operation> 97 96 <operation name="openotpNormalLogin"> 98 97 <soap:operation soapAction="openotpNormalLogin"/> 99 <input><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>100 <output><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>98 <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 99 <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 101 100 </operation> 102 101 <operation name="openotpLogin"> … … 104 103 It is kept for backward compatibility with OpenOTP v1.0. --> 105 104 <soap:operation soapAction="openotpLogin"/> 106 <input><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>107 <output><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>105 <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 106 <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 108 107 </operation> 109 108 <operation name="openotpChallenge"> 110 109 <soap:operation soapAction="openotpChallenge"/> 111 <input><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>112 <output><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>110 <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 111 <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 113 112 </operation> 114 113 <operation name="openotpStatus"> 115 114 <soap:operation soapAction="openotpStatus"/> 116 <input><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>117 <output><soap:body use=" literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>115 <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 116 <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 118 117 </operation> 119 118 </binding> … … 121 120 <service name="openotpService"> 122 121 <port name="openotpPort" binding="tns:openotpBinding"> 123 <soap:address location=" %ADDRESS%"/>122 <soap:address location="http://localhost:8080/openotp/"/> 124 123 </port> 125 124 </service> -
openotp-authentication/trunk/readme.txt
r1498033 r1533544 50 50 == Changelog == 51 51 52 = 1.2.4 = 53 - WebService API is now versioned 54 - U2F javascript scripts updated 55 - OTP Challenge input doesn't show anymore characters in clear text (type=password) 56 52 57 = 1.2.3 = 53 58 - Added support to OpenOTP Software Token to handle push logins
Note: See TracChangeset
for help on using the changeset viewer.