Plugin Directory

Changeset 1533544


Ignore:
Timestamp:
11/14/2016 08:36:19 AM (8 years ago)
Author:
rcdevs
Message:

U2F javascript scripts updated - WebService API is now versioned

Location:
openotp-authentication/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • openotp-authentication/trunk/openotp.class.php

    r1498033 r1533544  
    11<?php
    22/*
    3  RCDevs OpenOTP Plugin for RoundCube Webmail v2.0
    4  Copyright (c) 2010-2012 RCDevs, All rights reserved.
     3 RCDevs OpenOTP Plugin for Wordpress 4-6
     4 Copyright (c) 2010-2016 RCDevs, All rights reserved.
    55 
    66 This program is free software; you can redistribute it and/or
     
    201201            $options['stream_context'] = $stream_context;
    202202        }
    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        }                   
    205210        if (!$soap_client) {
    206211            return false;
    207212        }
    208213        $soap_client->setTimeout(30);       
     214        $soap_client->setVersion(2);       
    209215        $this->soap_client = $soap_client; 
    210216        return true;
     
    228234class SoapClientTimeout extends SoapClient {
    229235    private $timeout;
     236    private $version;
    230237
    231238    public function setTimeout ($timeout) {
    232239        $this->timeout = $timeout;
     240    }
     241    public function setVersion ($version) {
     242        $this->version = $version;
    233243    }
    234244
     
    246256            curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
    247257            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)));
    249259            curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout);
    250260
     
    257267    }
    258268}
    259 
    260 ?>
  • openotp-authentication/trunk/openotp.js

    r1498033 r1533544  
    8888    var new_width =  Math.round(c*div_width/base);
    8989    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 ){
    9294        document.getElementsByName('openotp_password')[0].focus();
    9395    }
     
    135137var timer = setInterval(function() {count();  }, 1000);
    136138
    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 ); 
     139if( 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 );
    144150    } else {
    145151        var u2f_activate = document.getElementById('u2f_activate');
     
    162168
    163169
    164 
  • openotp-authentication/trunk/openotp.wsdl

    r1498033 r1533544  
    1717    <part name="source" type="xsd:string"/>
    1818    <part name="settings" type="xsd:string"/>
    19     <part name="options" type="xsd:string"/>
    20     <part name="context" type="xsd:string"/>
    2119</message>
    2220
     
    3028    <part name="settings" type="xsd:string"/>
    3129    <part name="options" type="xsd:string"/>
    32     <part name="context" type="xsd:string"/>
    3330</message>
    3431
    3532<message name="openotpLoginResponse">
    3633    <part name="code" type="xsd:integer"/>
     34    <part name="error" type="xsd:string"/>
    3735    <part name="message" type="xsd:string"/>
    3836    <part name="session" type="xsd:string"/>
     
    5452<message name="openotpChallengeResponse">
    5553    <part name="code" type="xsd:integer"/>
     54    <part name="error" type="xsd:string"/>
    5655    <part name="message" type="xsd:string"/>
    5756    <part name="data" type="xsd:string"/>
     
    9291   <operation name="openotpSimpleLogin">
    9392      <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>
    9695   </operation>
    9796   <operation name="openotpNormalLogin">
    9897      <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>
    101100   </operation>
    102101   <operation name="openotpLogin">
     
    104103           It is kept for backward compatibility with OpenOTP v1.0. -->
    105104      <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>
    108107   </operation>
    109108   <operation name="openotpChallenge">
    110109      <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>
    113112   </operation>
    114113   <operation name="openotpStatus">
    115114      <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>
    118117   </operation>
    119118</binding>
     
    121120<service name="openotpService">
    122121   <port name="openotpPort" binding="tns:openotpBinding">
    123       <soap:address location="%ADDRESS%"/>
     122      <soap:address location="http://localhost:8080/openotp/"/>
    124123   </port>
    125124</service>
  • openotp-authentication/trunk/readme.txt

    r1498033 r1533544  
    5050== Changelog ==
    5151
     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
    5257= 1.2.3 =
    5358- Added support to OpenOTP Software Token to handle push logins
Note: See TracChangeset for help on using the changeset viewer.