Plugin Directory

Changeset 1892046


Ignore:
Timestamp:
06/13/2018 10:11:10 AM (8 years ago)
Author:
SecSign
Message:

version 1.7.14

Location:
secsign/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • secsign/trunk/jsApi/SecSignIDApi.js

    r1784672 r1892046  
    11/*!
    2  * (c) 2014, 2015, 2016 SecSign Technologies Inc.
     2 * (c) 2014 - 2018 SecSign Technologies Inc.
    33 */
    44 
     
    2020        referer : 'SecSignIDApi_JS',
    2121        pluginname : 'SecSignIDApi_JS',
    22         version : "1.36",
     22        version : "1.37",
    2323        optionalparams : null
    2424    };
     
    163163    var requestParameter = {
    164164        'request' : 'ReqCancelAuthSession',
    165         'secsignid' : options.secsignid.toLowerCase(), // ensure that the secsign id is lower case
    166         'authsessionid' : options.authsessionid,
    167         'requestid' : options.requestid
    168     };
    169     return this.sendRequest(requestParameter, options.callbackFunction);
    170 };
    171 
    172 
    173 //
    174 // Releases an authentication session if it was accepted and not used any longer
    175 //
    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',
    199165        'secsignid' : options.secsignid.toLowerCase(), // ensure that the secsign id is lower case
    200166        'authsessionid' : options.authsessionid,
     
    239205        async   : this.async
    240206    });
     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;
    241215
    242216    // add functions which are called when request is done or if it failed
    243217    request.done(function(response, textStatus, jqXHR){
     218        SecSignIDApi.task = undefined;
    244219        if(callbackFunction){
    245220            callbackFunction(instance.createResponseMap(response));
     
    248223   
    249224    request.fail(function(response, textStatus, jqXHR){
     225        SecSignIDApi.task = undefined;
    250226        if(typeof globalErrorFunc !== 'undefined'){
    251227            globalErrorFunc(response, textStatus);
     
    316292
    317293
     294//
     295// Try to open the mobile app
     296//
     297SecSignIDApi.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
    318366
    319367/**
  • secsign/trunk/jsApi/phpApi/SecSignIDApi.php

    r1784672 r1892046  
    214214            $response = $this->send($requestParameter, $authSession);
    215215           
    216             return $response['authsessionstate'];
    217         }
    218        
    219         /*
    220          * Releases an authentication session if it was accepted and not used any longer
    221          */
    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 
    235216            return $response['authsessionstate'];
    236217        }
  • secsign/trunk/jsApi/signin-bridge.php

    r1549267 r1892046  
    1414        // ReqRequestAuthSession
    1515        // ReqGetAuthSessionState
    16         // ReqReleaseAuthSession
    1716        // ReqCancelAuthSession
    1817       
     
    6463                        $response = $secSignIDApi->getResponse();
    6564                   
    66                     } else if(strcmp($_REQUEST['request'], "ReqReleaseAuthSession") == 0){
    67                
    68                         // send request to release authentication session from javascript api to id-server via php api
    69                         $secSignIDApi->releaseAuthSession($authsession);
    70                         $response = $secSignIDApi->getResponse();
    71                    
    7265                    } else if(strcmp($_REQUEST['request'], "ReqCancelAuthSession") == 0){
    7366         
  • secsign/trunk/readme.txt

    r1784672 r1892046  
    33Tags: 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
    44Requires at least: 3.0.1
    5 Tested up to: 4.9.1
     5Tested up to: 4.9.6
    66Stable tag: trunk
    77License: GPLv2 or later
     
    160160== Changelog ==
    161161
     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
     168Note: 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
    162170= 1.7.13 =
    163171* Added links to SecSign plugin website on Wordpress.org in plugin listing
  • secsign/trunk/secsignid_login.php

    r1784672 r1892046  
    33Plugin Name: SecSign
    44Plugin URI: https://www.secsign.com/wordpress-tutorial/
    5 Version: 1.7.13
     5Version: 1.7.14
    66Description: Two-factor authentication (2FA) with the SecSign ID. The SecSign plugin allows a user to login using his SecSign ID and his smartphone.
    77Author: SecSign Technologies Inc.
     
    932932        }
    933933
    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;
    935937    }
    936938}
Note: See TracChangeset for help on using the changeset viewer.