Changeset 1077585
- Timestamp:
- 01/28/2015 02:48:39 PM (10 years ago)
- Location:
- openotp-authentication/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
openotp-authentication/trunk/openotp.class.php
r787567 r1077585 212 212 } 213 213 214 public function openOTPChallenge($username, $domain, $state, $password ){214 public function openOTPChallenge($username, $domain, $state, $password, $u2f){ 215 215 if (!$this->soapRequest()) return false; 216 $resp = $this->soap_client->openotpChallenge($username, $domain, $state, $password );216 $resp = $this->soap_client->openotpChallenge($username, $domain, $state, $password, $u2f); 217 217 218 218 return $resp; -
openotp-authentication/trunk/openotp.js
r787567 r1077585 32 32 overlay.style.MozBoxShadow = '1px 1px 12px #555555'; 33 33 overlay.style.zIndex = "9999"; 34 overlay.innerHTML = '<a style="position:absolute; top:-12px; right:-12px; background-color:transparent;" href="wp-login.php" title="close"><img src="'+otp_settings.openotp_path+'openotp_closebtn.png"/></a>' 34 oinnerHTML = '<a style="position:absolute; top:-12px; right:-12px; background-color:transparent;" href="wp-login.php" title="close"><img src="'+otp_settings.openotp_path+'openotp_closebtn.png"/></a>' 35 + '<style>' 36 + 'blink { -webkit-animation: blink 1s steps(5, start) infinite; -moz-animation: blink 1s steps(5, start) infinite; -o-animation: blink 1s steps(5, start) infinite; animation: blink 1s steps(5, start) infinite; }' 37 + ' @-webkit-keyframes blink { to { visibility: hidden; } }' 38 + '@-moz-keyframes blink { to { visibility: hidden; } }' 39 + '@-o-keyframes blink { to { visibility: hidden; } }' 40 + '@keyframes blink { to { visibility: hidden; } }' 41 + '</style>' 35 42 + '<div style="background-color:red; margin:0 -40px 0; height:4px; width:360px; padding:0;" id="count_red"><div style="background-color:orange; margin:0; height:4px; width:360px; padding:0;" id="div_orange"></div></div>' 36 + '<form style="margin:30px 0 0 0; padding:0; background:none; box-shadow:none;" action="wp-login.php" name="loginform " method="POST">'43 + '<form style="margin:30px 0 0 0; padding:0; background:none; box-shadow:none;" action="wp-login.php" name="loginform1" id="openotpform" method="POST">' 37 44 + '<input type="hidden" name="redirect_to" value="'+redirect_to+'">' 38 45 + '<input type="hidden" name="testcookie" value="1">' … … 42 49 + '<input type="hidden" name="openotp_username" value="'+otp_settings.openotp_username+'">' 43 50 + '<input type="hidden" name="openotp_ldappw" value="'+otp_settings.openotp_ldappw+'">' 51 + '<input type="hidden" name="form_send" value="1">' 44 52 + '<table width="100%">' 45 53 + '<tr style="border:none;"><td style="text-align:center; font-weight:bold; font-size:14px; border:none;">'+otp_settings.openotp_message+'</td></tr>' 46 + '<tr style="border:none;"><td id="timout_cell" style="text-align:center; padding-top:4px; font-weight:bold; font-style:italic; font-size:11px; border:none;">Timeout: <span id="timeout">'+otp_settings.openotp_timeout+' seconds</span></td></tr>' 47 + '<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"> ' 48 + '<input style="vertical-align:middle; padding:0 10px;" name="submit" type="submit" value="Ok" class="button btn btn-primary"></td></tr>' 49 + '</table></form>'; 54 + '<tr style="border:none;"><td id="timout_cell" style="text-align:center; padding-top:4px; font-weight:bold; font-style:italic; font-size:11px; border:none;">Timeout: <span id="timeout">'+otp_settings.openotp_timeout+' seconds</span></td></tr>'; 55 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"> ' 58 + '<input style="vertical-align:middle; padding:0 10px;" name="submit1" type="submit" value="Ok" class="button btn btn-primary"></td></tr>'; 59 } 60 61 if( otp_settings.openotp_u2fChallenge){ 62 oinnerHTML += '<tr style=\"border:none;\"><td id=\"inputs_cell\" style=\"text-align:center; padding-top:5px; border:none;\"><input type=\"hidden\" name=\"openotp_u2f\" value=\"\">'; 63 if( otp_settings.openotp_otpChallenge){ 64 oinnerHTML += '<br/><b>U2F response</b> <blink id=\"u2f_activate\">[Activate Device]</blink></td></tr>'; 65 } else { 66 oinnerHTML += '<img src=\"'+otp_settings.openotp_path+'/u2f.png\"><br><br><blink id=\"u2f_activate\">[Activate Device]</blink></td></tr>'; 67 } 68 } 69 70 oinnerHTML += '</table></form>'; 71 overlay.innerHTML = oinnerHTML; 50 72 51 73 document.body.appendChild(overlay_bg); … … 54 76 55 77 addOpenOTPDivs(); 78 56 79 57 80 /* Compute Timeout */ … … 66 89 document.getElementById('div_orange').style.width=new_width+'px'; 67 90 91 if( document.getElementById('openotp_password') ){ 92 document.getElementById('openotp_password').focus(); 93 } 94 68 95 if(c == 0 || c < 0) { 69 96 c = 0; … … 75 102 } 76 103 count(); 77 var timer = setInterval(function() {count(); }, 1000); 104 105 function getInternetExplorerVersion() { 106 107 var rv = -1; 108 109 if (navigator.appName == "Microsoft Internet Explorer") { 110 var ua = navigator.userAgent; 111 var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 112 if (re.exec(ua) != null) 113 rv = parseFloat(RegExp.$1); 114 } 115 return rv; 116 } 117 118 var ver = getInternetExplorerVersion(); 119 120 if (navigator.appName == "Microsoft Internet Explorer"){ 121 if (ver <= 10){ 122 toggleItem = function(){ 123 124 var el = document.getElementsByTagName("blink")[0]; 125 if (el.style.display === "block") { 126 el.style.display = "none"; 127 } else { 128 el.style.display = "block"; 129 } 130 } 131 var t = setInterval(function() {toggleItem; }, 1000); 132 } 133 } 134 135 var timer = setInterval(function() {count(); }, 1000); 136 137 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 ); 146 } 147 } -
openotp-authentication/trunk/openotp.php
r787567 r1077585 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. 1.07 * Version: 1.2.0 8 8 * Author URI: https://www.rcdevs.com 9 9 * License: GPL2+ … … 45 45 private $username = null; 46 46 private $password = null; 47 private $u2f = null; 48 private $u2fChallenge = null; 49 private $otpChallenge = null; 47 50 private $rememberme = null; 48 51 private $show_openotp_challenge = false; … … 109 112 110 113 add_filter( 'plugin_action_links', array( $this, 'filter_plugin_action_links' ), 10, 2 ); 111 114 115 112 116 // Anything other than plugin configuration belongs in here. 113 117 if ( $this->ready ) { … … 127 131 // add Login Form Overlay 128 132 add_action('login_enqueue_scripts', array( $this, 'openotp_AddJSToLogin' )); 129 } 130 } 133 134 } 135 } 136 131 137 132 138 /** … … 596 602 597 603 598 604 public function js_inside_body() { 605 $c = "<script src=\"chrome-extension://pfboblefjcgdjicmnffhdgionmgcdmne/u2f-api.js\" type=\"text/javascript\"></script>"; 606 echo $c; 607 } 608 599 609 public function openotp_AddJSToLogin(){ 600 610 if($this->show_openotp_challenge){ 611 $this->js_inside_body(); 612 //wp_enqueue_script( 'u2f_api', '//chrome-extension://pfboblefjcgdjicmnffhdgionmgcdmne/u2f-api.js', array(), '3', true); 613 601 614 wp_enqueue_script( 'openotp_overlay', plugin_dir_url( __FILE__ ) . 'openotp.js',null,'',true); 602 615 wp_localize_script( 'openotp_overlay', 'otp_settings', array( … … 606 619 'openotp_timeout' => $this->timeout, 607 620 'openotp_ldappw' => $this->password, 621 'openotp_u2fChallenge' => $this->u2fChallenge, 622 'openotp_otpChallenge' => $this->otpChallenge, 608 623 'openotp_path' => plugin_dir_url( __FILE__ ), 609 624 'openotp_domain' => $this->domain, … … 619 634 public function authenticate_user( $user = '', $username = '', $password = '' ) { 620 635 // Form not send 621 if( !isset( $_POST['wp-submit']) && !isset( $_POST['submit']) ) { 636 637 if( !isset( $_POST['wp-submit']) && !isset( $_POST['form_send']) ) { 622 638 return $user; 623 639 } … … 625 641 $this->username = isset($_POST['openotp_username']) && $_POST['openotp_username'] != NULL ? $_POST['openotp_username'] : $username; 626 642 $this->password = isset($_POST['openotp_password']) && $_POST['openotp_password'] != NULL ? $_POST['openotp_password'] : $password; 643 $this->u2f = isset($_POST['openotp_u2f']) ? stripslashes($_POST['openotp_u2f']) : ""; 644 627 645 $state = isset($_POST['openotp_state']) ? $_POST['openotp_state'] : ""; 628 646 $this->rememberme = isset($_POST['rememberme']) ? $_POST['rememberme'] : ""; … … 666 684 if ($state != NULL) { 667 685 // OpenOTP Challenge 668 $resp = $this->openotp_auth->openOTPChallenge($this->username, $this->domain, $state, $this->password); 686 //echo $this->u2f; die; 687 $resp = $this->openotp_auth->openOTPChallenge($this->username, $this->domain, $state, $this->password, $this->u2f); 669 688 } else { 670 689 // OpenOTP Login … … 695 714 696 715 $resp['domain'] = $this->domain; 716 $this->u2fChallenge = $resp['u2fChallenge']; 717 $this->otpChallenge = $resp['otpChallenge']; 697 718 $this->show_openotp_challenge = true; 698 719 break; -
openotp-authentication/trunk/openotp.wsdl
r787567 r1077585 17 17 <part name="source" type="xsd:string"/> 18 18 <part name="settings" type="xsd:string"/> 19 <part name="options" type="xsd:string"/> 19 20 </message> 20 21 … … 27 28 <part name="source" type="xsd:string"/> 28 29 <part name="settings" type="xsd:string"/> 30 <part name="options" type="xsd:string"/> 29 31 </message> 30 32 … … 35 37 <part name="data" type="xsd:string"/> 36 38 <part name="timeout" type="xsd:integer"/> 39 <part name="otpChallenge" type="xsd:string"/> 40 <part name="u2fChallenge" type="xsd:string"/> 37 41 </message> 38 42 … … 42 46 <part name="session" type="xsd:string"/> 43 47 <part name="otpPassword" type="xsd:string"/> 48 <part name="u2fResponse" type="xsd:string"/> 44 49 </message> 45 50 … … 113 118 <service name="openotpService"> 114 119 <port name="openotpPort" binding="tns:openotpBinding"> 115 <soap:address location=" http://localhost:8080/openotp/"/>120 <soap:address location="%ADDRESS%"/> 116 121 </port> 117 122 </service> -
openotp-authentication/trunk/readme.txt
r787576 r1077585 4 4 Donate link: http://rcdevs.com/ 5 5 Requires at least: 3.0 6 Tested up to: 3.6.16 Tested up to: 4.1 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 12 12 13 13 == Description == 14 This Plugin enables strong two factor authentication for admins and users. It displays an overlay on Challenge-Response session, after fill in username and password. The plugin supports global, per role and per user settings configuration. The plugin will transparently handle any OpenOTP Login Mode including, LDAP only, OTP only and LDAP+OTP.15 14 16 15 It is versatile, device-independent and based on opened security standards. … … 40 39 = Is OpenOTP's two-factor service really free? = 41 40 42 Yes, OpenOTP is free up to 35users, for more details please contact us.41 Yes, OpenOTP is free up to 40 users, for more details please contact us. 43 42 44 43 == Screenshots == … … 49 48 50 49 == Changelog == 50 51 = 1.2.0 = 52 - Added support for OpenOTP v1.2 and FIDO U2F authentication. 51 53 52 54 = 1.1.0 = … … 61 63 == Upgrade Notice == 62 64 65 = 1.2.0 = 66 - Added support for OpenOTP v1.2 and FIDO U2F authentication. 67 63 68 = 1.1.0 = 64 69 Initial release!
Note: See TracChangeset
for help on using the changeset viewer.