Changeset 1892046
- Timestamp:
- 06/13/2018 10:11:10 AM (8 years ago)
- Location:
- secsign/trunk
- Files:
-
- 5 edited
-
jsApi/SecSignIDApi.js (modified) (6 diffs)
-
jsApi/phpApi/SecSignIDApi.php (modified) (1 diff)
-
jsApi/signin-bridge.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
secsignid_login.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
secsign/trunk/jsApi/SecSignIDApi.js
r1784672 r1892046 1 1 /*! 2 * (c) 2014 , 2015, 2016SecSign Technologies Inc.2 * (c) 2014 - 2018 SecSign Technologies Inc. 3 3 */ 4 4 … … 20 20 referer : 'SecSignIDApi_JS', 21 21 pluginname : 'SecSignIDApi_JS', 22 version : "1.3 6",22 version : "1.37", 23 23 optionalparams : null 24 24 }; … … 163 163 var requestParameter = { 164 164 'request' : 'ReqCancelAuthSession', 165 'secsignid' : options.secsignid.toLowerCase(), // ensure that the secsign id is lower case166 'authsessionid' : options.authsessionid,167 'requestid' : options.requestid168 };169 return this.sendRequest(requestParameter, options.callbackFunction);170 };171 172 173 //174 // Releases an authentication session if it was accepted and not used any longer175 //176 SecSignIDApi.prototype.releaseAuthSession = function(options) {177 178 if(!options){179 throw new Error("No options given to release authentication session.");180 }181 182 if(!options.secsignid || !options.authsessionid || !options.requestid){183 throw new Error("Missing values in options to release authentication session.");184 }185 186 /*187 options = {188 secsignid : "titus",189 requestid : "98723408097328623947235",190 authsessionid : "-872346324",191 callbackFunction : function(){192 ...193 }194 }195 */196 197 var requestParameter = {198 'request' : 'ReqReleaseAuthSession',199 165 'secsignid' : options.secsignid.toLowerCase(), // ensure that the secsign id is lower case 200 166 'authsessionid' : options.authsessionid, … … 239 205 async : this.async 240 206 }); 207 208 // check whether the apis in this website are already processing a task... 209 if(SecSignIDApi.task){ 210 console.log("SecSignIDApi is already running task " + SecSignIDApi.task); 211 return this; 212 } 213 214 SecSignIDApi.task = params.request; 241 215 242 216 // add functions which are called when request is done or if it failed 243 217 request.done(function(response, textStatus, jqXHR){ 218 SecSignIDApi.task = undefined; 244 219 if(callbackFunction){ 245 220 callbackFunction(instance.createResponseMap(response)); … … 248 223 249 224 request.fail(function(response, textStatus, jqXHR){ 225 SecSignIDApi.task = undefined; 250 226 if(typeof globalErrorFunc !== 'undefined'){ 251 227 globalErrorFunc(response, textStatus); … … 316 292 317 293 294 // 295 // Try to open the mobile app 296 // 297 SecSignIDApi.openMobileApp = function(login){ 298 if(!login){ 299 // login map with information about secsign id, id server etc is not set 300 return; 301 } 302 303 var $ = jQuery; 304 login = $.extend({"appid" : "com.secsign.secsignid"}, login); 305 306 if(login.noparam){ 307 window.location = login.appid + "://returnToApp"; 308 return; 309 } 310 311 // get browser information 312 if(! $.device){ $.device = {}; } 313 $.device.mobile = /(Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone)/i.test(navigator.userAgent); 314 $.device.iphone = /(iPhone).*AppleWebKit.*Safari/i.test(navigator.userAgent); 315 $.device.ipad = /(iPad).*AppleWebKit.*Safari/i.test(navigator.userAgent); 316 $.device.android = /android/i.test(navigator.userAgent); 317 318 if(! $.os){ $.os = {}; } 319 $.os.iOS = { 320 version : -1 321 }; 322 323 if($.device.iphone || $.device.ipad){ 324 var match = navigator.userAgent.match(/OS (\d{1,2})_/i); 325 if(match && match[1]){ 326 $.os.iOS.version = parseInt(match[1]); 327 } 328 } 329 330 if(! $.browser){ $.browser = {}; } 331 $.browser.chrome = /Chrome/.test(navigator.userAgent) || /CriOS/.test(navigator.userAgent); 332 $.browser.safari = ($.browser.webkit && !$.browser.chrome); // in other browser like opera and firefox $.browser.webkit is undefined. 333 $.browser.atomic = /U;/.test(navigator.userAgent) && !$.browser.chrome && $.browser.safari; 334 $.browser.firefox = /firefox/i.test(navigator.userAgent) && $.browser.webkit == undefined; 335 $.browser.opera = /opera/i.test(navigator.userAgent) && $.browser.webkit == undefined; 336 $.browser.edge = /Windows(.*)Edge/.test(navigator.userAgent); 337 338 // encode uri to ensure that parameter in the return url are not cut off in the app. 339 login["returnurl"] = encodeURIComponent(login["returnurl"]); 340 341 if ($.device.iphone) 342 { 343 // try to open the app 344 if ($.os.iOS.version >= 9){ 345 window.location = login.appid + "://authenticate?secsignid=" + login["secsignid"] + 346 "&authsessionid=" + login["authsessionid"] + 347 "&returnurl=" + login["returnurl"] + 348 "&idserverurl=" + login["idserverurl"]; 349 } 350 else { 351 // append an iframe to force the app being openend 352 $("body").append("<iframe style='display:none;' src='" + 353 login.appid + "://authenticate?secsignid=" + login["secsignid"] + 354 "&authsessionid=" + login["authsessionid"] + 355 "&returnurl=" + login["returnurl"] + 356 "&idserverurl=" + login["idserverurl"] + "' />"); 357 } 358 } else { 359 window.location = login.appid + "://authenticate?secsignid=" + login["secsignid"] + 360 "&authsessionid=" + login["authsessionid"] + 361 "&returnurl=" + login["returnurl"] + 362 "&idserverurl=" + login["idserverurl"]; 363 } 364 }; 365 318 366 319 367 /** -
secsign/trunk/jsApi/phpApi/SecSignIDApi.php
r1784672 r1892046 214 214 $response = $this->send($requestParameter, $authSession); 215 215 216 return $response['authsessionstate'];217 }218 219 /*220 * Releases an authentication session if it was accepted and not used any longer221 */222 function releaseAuthSession($authSession)223 {224 $this->log("Call of function 'releaseAuthSession'.");225 226 if($authSession == NULL || !($authSession instanceof AuthSession)){227 $message = "Parameter \$authSession is not an instance of AuthSession. get_class(\$authSession)=" . get_class($authSession);228 $this->log($message);229 throw new Exception($message);230 }231 232 $requestParameter = array('request' => 'ReqReleaseAuthSession');233 $response = $this->send($requestParameter, $authSession);234 235 216 return $response['authsessionstate']; 236 217 } -
secsign/trunk/jsApi/signin-bridge.php
r1549267 r1892046 14 14 // ReqRequestAuthSession 15 15 // ReqGetAuthSessionState 16 // ReqReleaseAuthSession17 16 // ReqCancelAuthSession 18 17 … … 64 63 $response = $secSignIDApi->getResponse(); 65 64 66 } else if(strcmp($_REQUEST['request'], "ReqReleaseAuthSession") == 0){67 68 // send request to release authentication session from javascript api to id-server via php api69 $secSignIDApi->releaseAuthSession($authsession);70 $response = $secSignIDApi->getResponse();71 72 65 } else if(strcmp($_REQUEST['request'], "ReqCancelAuthSession") == 0){ 73 66 -
secsign/trunk/readme.txt
r1784672 r1892046 3 3 Tags: two-factor authentication, two-factor, authentication, 2 factor authentication, login, sign in, single sign-on, challenge response, rsa, password, mobile, iphone, android, security, authenticator, authenticate, two step authentication, 2fa, tfa 4 4 Requires at least: 3.0.1 5 Tested up to: 4.9. 15 Tested up to: 4.9.6 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 160 160 == Changelog == 161 161 162 = 1.7.14 = 163 * Added workaround for port issue on misconfigured apache server 164 * Added new PHP API 165 * Added new JS API 166 * Tested WP compatibility for Wordpress 4.9.6 167 168 Note: Due to changes at the javascript files, please flush the page cache or any other cache you are using to have the updated files within the browser. 169 162 170 = 1.7.13 = 163 171 * Added links to SecSign plugin website on Wordpress.org in plugin listing -
secsign/trunk/secsignid_login.php
r1784672 r1892046 3 3 Plugin Name: SecSign 4 4 Plugin URI: https://www.secsign.com/wordpress-tutorial/ 5 Version: 1.7.1 35 Version: 1.7.14 6 6 Description: Two-factor authentication (2FA) with the SecSign ID. The SecSign plugin allows a user to login using his SecSign ID and his smartphone. 7 7 Author: SecSign Technologies Inc. … … 932 932 } 933 933 934 return $prot . "://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . $post_url; 934 //return $prot . "://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . $post_url; 935 936 return $post_url; 935 937 } 936 938 }
Note: See TracChangeset
for help on using the changeset viewer.