Changeset 1498033
- Timestamp:
- 09/19/2016 09:51:50 AM (9 years ago)
- Location:
- openotp-authentication/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
openotp-authentication/trunk/openotp.class.php
r1077585 r1498033 196 196 } 197 197 } 198 199 $soap_client = new SoapClient(dirname(__FILE__).'/openotp.wsdl', $options); 198 199 $stream_context = stream_context_create(array('ssl' => array('verify_peer' => false))); 200 if ($stream_context){ 201 $options['stream_context'] = $stream_context; 202 } 203 204 $soap_client = new SoapClientTimeout(dirname(__FILE__).'/openotp.wsdl', $options); 200 205 if (!$soap_client) { 201 206 return false; 202 207 } 208 $soap_client->setTimeout(30); 203 209 $this->soap_client = $soap_client; 204 210 return true; … … 207 213 public function openOTPSimpleLogin($username, $domain, $password){ 208 214 if (!$this->soapRequest()) return false; 209 $resp = $this->soap_client->openotpSimpleLogin($username, $domain, $password, $this->client_id, $_SERVER["REMOTE_ADDR"], $this->user_settings );215 $resp = $this->soap_client->openotpSimpleLogin($username, $domain, $password, $this->client_id, $_SERVER["REMOTE_ADDR"], $this->user_settings, NULL, NULL); 210 216 211 217 return $resp; … … 220 226 } 221 227 228 class SoapClientTimeout extends SoapClient { 229 private $timeout; 230 231 public function setTimeout ($timeout) { 232 $this->timeout = $timeout; 233 } 234 235 public function __doRequest($request, $location, $action, $version, $one_way=false) { 236 if (!$this->timeout) { 237 // Call via parent because we require no timeout 238 $response = parent::__doRequest($request, $location, $action, $version, $one_way); 239 } else { 240 // Call via Curl and use the timeout 241 $curl = curl_init($location); 242 243 curl_setopt($curl, CURLOPT_VERBOSE, false); 244 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 245 curl_setopt($curl, CURLOPT_POST, true); 246 curl_setopt($curl, CURLOPT_POSTFIELDS, $request); 247 curl_setopt($curl, CURLOPT_HEADER, false); 248 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml")); 249 curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout); 250 251 $response = curl_exec($curl); 252 if (curl_errno($curl)) throw new Exception(curl_error($curl)); 253 curl_close($curl); 254 } 255 256 if (!$one_way) return ($response); 257 } 258 } 259 222 260 ?> -
openotp-authentication/trunk/openotp.js
r1077585 r1498033 55 55 56 56 if( otp_settings.openotp_otpChallenge || ( !otp_settings.openotp_otpChallenge && !otp_settings.openotp_u2fChallenge ) ){ 57 oinnerHTML += '<tr style="border:none;"><td id="inputs_cell" style="text-align:center; padding-top:25px; border:none;"><input style="border:1px solid grey; background-color:white; margin-top:0; margin-bottom:0; padding:3px; vertical-align:middle; font-size:14px; width:auto;" type=" text" size=15 name="openotp_password"> '57 oinnerHTML += '<tr style="border:none;"><td id="inputs_cell" style="text-align:center; padding-top:25px; border:none;"><input style="border:1px solid grey; background-color:white; margin-top:0; margin-bottom:0; padding:3px; vertical-align:middle; font-size:14px; width:auto;" type="password" size=15 name="openotp_password"> ' 58 58 + '<input style="vertical-align:middle; padding:0 10px;" name="submit1" type="submit" value="Ok" class="button btn btn-primary"></td></tr>'; 59 59 } … … 89 89 document.getElementById('div_orange').style.width=new_width+'px'; 90 90 91 if( document.getElement ById('openotp_password') ){92 document.getElement ById('openotp_password').focus();91 if( document.getElementsByName('openotp_password') ){ 92 document.getElementsByName('openotp_password')[0].focus(); 93 93 } 94 94 … … 137 137 138 138 if( otp_settings.openotp_u2fChallenge){ 139 if (typeof u2f !== 'object' || typeof u2f.sign !== 'function'){ var u2f_activate = document.getElementById('u2f_activate'); u2f_activate.innerHTML = '[Not Supported]'; u2f_activate.style.color='red'; } 140 else { u2f.sign([ JSON.parse(otp_settings.openotp_u2fChallenge)], 141 function(response) { 142 document.getElementsByName('openotp_u2f')[0].value = JSON.stringify(response); 143 document.getElementById("openotpform").submit(); }, 144 otp_settings.openotp_timeout 145 ); 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 ); 144 } else { 145 var u2f_activate = document.getElementById('u2f_activate'); 146 u2f_activate.innerHTML = '[Not Supported]'; 147 u2f_activate.style.color='red'; 146 148 } 147 149 } 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 -
openotp-authentication/trunk/openotp.php
r1077585 r1498033 5 5 * Description: Add <a href="http://www.rcdevs.com/">OpenOTP</a> two-factor authentication to WordPress. 6 6 * Author: RCDevs Inc 7 * Version: 1.2. 07 * Version: 1.2.3 8 8 * Author URI: https://www.rcdevs.com 9 9 * License: GPL2+ … … 441 441 442 442 <?php else : ?> 443 <p><?php printf( __( 'To use the OpenOTP plugin on Wordpress, you must do ownload and configure OpenOTP server <a href="%1$s"><strong>%1$s</strong></a>.', 'opneotp' ), 'http://www.rcdevs.com' ); ?></p>443 <p><?php printf( __( 'To use the OpenOTP plugin on Wordpress, you must download and configure OpenOTP server <a href="%1$s"><strong>%1$s</strong></a>.', 'openotp' ), 'http://www.rcdevs.com' ); ?></p> 444 444 <p><?php _e( "Once you've configured your server, enter at least your server url in the fields below.", 'openotp' ); ?></p> 445 445 <p><?php printf( __( 'Until your server URL is entered, the %s plugin cannot function.', 'openotp' ), $plugin_name ); ?></p> … … 609 609 public function openotp_AddJSToLogin(){ 610 610 if($this->show_openotp_challenge){ 611 $this->js_inside_body();611 //$this->js_inside_body(); 612 612 //wp_enqueue_script( 'u2f_api', '//chrome-extension://pfboblefjcgdjicmnffhdgionmgcdmne/u2f-api.js', array(), '3', true); 613 613 614 wp_enqueue_script( 'fidou2f', plugin_dir_url( __FILE__ ) . 'fidou2f.js',null,'',true); 614 615 wp_enqueue_script( 'openotp_overlay', plugin_dir_url( __FILE__ ) . 'openotp.js',null,'',true); 615 616 wp_localize_script( 'openotp_overlay', 'otp_settings', array( -
openotp-authentication/trunk/openotp.wsdl
r1077585 r1498033 18 18 <part name="settings" type="xsd:string"/> 19 19 <part name="options" type="xsd:string"/> 20 <part name="context" type="xsd:string"/> 20 21 </message> 21 22 … … 29 30 <part name="settings" type="xsd:string"/> 30 31 <part name="options" type="xsd:string"/> 32 <part name="context" type="xsd:string"/> 31 33 </message> 32 34 … … 36 38 <part name="session" type="xsd:string"/> 37 39 <part name="data" type="xsd:string"/> 40 <part name="concat" type="xsd:integer"/> 38 41 <part name="timeout" type="xsd:integer"/> 39 42 <part name="otpChallenge" type="xsd:string"/> … … 89 92 <operation name="openotpSimpleLogin"> 90 93 <soap:operation soapAction="openotpSimpleLogin"/> 91 <input><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>92 <output><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>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 96 </operation> 94 97 <operation name="openotpNormalLogin"> 95 98 <soap:operation soapAction="openotpNormalLogin"/> 96 <input><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>97 <output><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>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 101 </operation> 99 102 <operation name="openotpLogin"> … … 101 104 It is kept for backward compatibility with OpenOTP v1.0. --> 102 105 <soap:operation soapAction="openotpLogin"/> 103 <input><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>104 <output><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>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 108 </operation> 106 109 <operation name="openotpChallenge"> 107 110 <soap:operation soapAction="openotpChallenge"/> 108 <input><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>109 <output><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>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 113 </operation> 111 114 <operation name="openotpStatus"> 112 115 <soap:operation soapAction="openotpStatus"/> 113 <input><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>114 <output><soap:body use=" encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>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 118 </operation> 116 119 </binding> -
openotp-authentication/trunk/readme.txt
r1077591 r1498033 4 4 Donate link: http://rcdevs.com/ 5 5 Requires at least: 3.0 6 Tested up to: 4. 17 Stable tag: 1.2. 06 Tested up to: 4.6 7 Stable tag: 1.2.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 11 OpenOTP plugin Enable two-factor authentication for your admins and/or users 12 The plugin will transparently handle any OpenOTP Login Mode including, LDAP only, OTP only and LDAP+OTP/U2F. 12 13 13 14 == Description == 14 15 15 16 It is versatile, device-independent and based on opened security standards. 16 OpenOTP provides fine-grained user identity and access management (IAM), one-time passwords authentication technologies (OTP) and extensive authentication policies for your AD / LDAP users.17 OpenOTP provides fine-grained user identity and access management (IAM), one-time passwords authentication technologies (OTP), Universal Second Factor (U2F) and extensive authentication policies for your AD / LDAP users. 17 18 It is enterprise-ready with strong support for high-availability, load-balancing, multi-tenancy, cloud-readiness, geolocalization, delegated administration and much more. 18 19 … … 49 50 == Changelog == 50 51 52 = 1.2.3 = 53 - Added support to OpenOTP Software Token to handle push logins 54 Extend php soapclient to add timeout capabilities 55 56 = 1.2.2 = 57 - Fixed SSL issue with PHP 5.6+ 58 - Enhanced FIDO U2F Library calls 59 60 = 1.2.1 = 61 - Added support for OpenOTP v1.2.1 62 51 63 = 1.2.0 = 52 64 - Added support for OpenOTP v1.2 and FIDO U2F authentication. … … 62 74 63 75 == Upgrade Notice == 76 = 1.2.3 = 77 - No breaking risks, just overwrite old plugins versions 78 79 = 1.2.2 = 80 - Fixed SSL issue with PHP 5.6+ 81 - Enhanced FIDO U2F Library calls 82 83 = 1.2.1 = 84 - Added support for OpenOTP v1.2.1 64 85 65 86 = 1.2.0 =
Note: See TracChangeset
for help on using the changeset viewer.