<?xml version="1.0" encoding="UTF-8"?>
<authdriver id="authfront.otp" enabled="false" name="authfront.otp" label="CONF_MESSAGE[Authentication One-time-password]" description="CONF_MESSAGE[Use Google Authenticator, Yubikey or standard password to authenticate users.]" mixins="authdriver_commons"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
    <plugin_info>
        <plugin_author>Janos Milus / Tran Cuong</plugin_author>
        <plugin_version>0.8</plugin_version>
        <plugin_uri>http://pyd.io/plugins/authfront/otp</plugin_uri>
        <core_relation packaged="true" tested_version="follow_core"/>
    </plugin_info>
    <client_settings>
        <resources>
            <i18n namespace="authfront.otp" path="plugins/authfront.otp/i18n"/>
            <js className="OTPAuthfrontActions" file="plugins/authfront.otp/res/build/OTPAuthfrontActions.js"/>
            <css file="plugins/authfront.otp/configurator.css" autoload="true"/>
        </resources>
    </client_settings>
    <server_settings>
        <global_param group="CONF_MESSAGE[Options]" name="ORDER" type="integer" label="CONF_MESSAGE[Order]" description="CONF_MESSAGE[Order this plugin with other auth frontends]" default="13"/>
        <global_param group="CONF_MESSAGE[Options]" name="PROTOCOL_TYPE" type="select"
                      choices="session_only|CONF_MESSAGE[Sessions Only]"
                      label="CONF_MESSAGE[Protocol Type]" description="CONF_MESSAGE[Enable/disable automatically based on the protocol used]" default="session_only" editable="false"/>
        <global_param  group="CONF_MESSAGE[Options]" expose="true" name="MODIFY_LOGIN_SCREEN" type="boolean" label="CONF_MESSAGE[Modify login page]"
                       description="CONF_MESSAGE[Login page will be modified to give user a OTP textbox.]" default="true"/>
        <global_param group="CONF_MESSAGE[Options]" name="YUBICO_SECRET_KEY" type="string" label="CONF_MESSAGE[Yubico Secret Key]" description="CONF_MESSAGE[Yubico secret key attached to your account]" mandatory="false"/>
        <global_param group="CONF_MESSAGE[Options]" name="YUBICO_CLIENT_ID" type="string" label="CONF_MESSAGE[Yubico Client ID]" description="CONF_MESSAGE[Yubico client id attached to your account]" mandatory="false"/>
        <param name="yubikey_enabled" group="CONF_MESSAGE[Yubikey]" type="boolean" label="CONF_MESSAGE[Use Yubikey]"  description="CONF_MESSAGE[Require a Yubikey usage by the user.]" mandatory="false" default="false" expose="true" scope="user,group"/>
        <param name="yubikey1" group="CONF_MESSAGE[Yubikey]" type="string" label="CONF_MESSAGE[Your YubiKey ID]"  description="CONF_MESSAGE[YubiKey ID. To add a yubikey, simply use your key button to fill this field.]" mandatory="false" expose="true" scope="user"/>
        <param name="yubikey2" group="CONF_MESSAGE[Yubikey]" type="string" label="CONF_MESSAGE[Second YubiKey ID]"  description="CONF_MESSAGE[YubiKey ID. To add a second yubikey, simply use your key button to fill this field.]" mandatory="false" expose="true" scope="user"/>
        <param name="google_enabled_admin" group="CONF_MESSAGE[Google Authenticator]" type="boolean" label="CONF_MESSAGE[Force Google Authenticator]"  description="CONF_MESSAGE[Force Google Auth usage without letting the choice to the user.]" mandatory="false" default="false" scope="user,group"/>
        <param name="google_enabled" group="CONF_MESSAGE[Google Authenticator]" type="boolean" label="CONF_MESSAGE[Enable Google Authenticator]"  description="CONF_MESSAGE[If you enable it for the first time, you will be able to configure Google Authenticator application next time you log in.]" mandatory="false" default="false" scope="user,group" expose="true"/>
        <param name="google" group="CONF_MESSAGE[Google Authenticator]" type="string" label="CONF_MESSAGE[Google Authenticator Secret]"  description="CONF_MESSAGE[Google Authenticator Secret Key.]" mandatory="false" scope="user"/>
        <param name="google_last" group="CONF_MESSAGE[Google Authenticator]" type="integer" label="CONF_MESSAGE[Google Authenticator Last]"  description="CONF_MESSAGE[Google Authenticator replay protection, do not edit]" mandatory="false" editable="false"/>
    </server_settings>
    <class_definition filename="plugins/authfront.otp/OtpAuthFrontend.php" classname="Pydio\Auth\Frontend\OtpAuthFrontend"/>
    <registry_contributions>
        <external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*" exclude=""/>
        <actions>
            <action name="otp_show_setup_screen">
                <gui iconClass="icon-key" text="authfront.otp.1" title="authfront.otp.1">
                    <context dir="true" recycle="false" selection="false"/>
                </gui>
                <processing>
                    <clientCallback module="OTPAuthfrontActions.Callbacks.setupScreen"/>
                    <serverCallback methodName="getConfigurationCode"/>
                </processing>
            </action>
        </actions>
        <client_configs>
            <component_config component="AuthfrontCoreActions.LoginPasswordDialog">
                <modifier module="OTPAuthfrontActions.LoginDialogModifier"/>
            </component_config>
        </client_configs>
    </registry_contributions>
</authdriver>