Skip to content
Snippets Groups Projects
Unverified Commit ababbcc1 authored by briancanini's avatar briancanini Committed by GitHub
Browse files

Merge pull request #394 from ASCWebServices/yubikey-fix

Remove case-sensitive colliding simplesaml/authYubiKey
parents 5bf53aa0 c624a9b5
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 395 deletions
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: SimpleSAMLphp 1.15\n"
"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n"
"POT-Creation-Date: 2016-10-12 09:23+0200\n"
"PO-Revision-Date: 2016-10-14 12:14+0200\n"
"Last-Translator: \n"
"Language: sr\n"
"Language-Team: \n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
msgid "{authYubiKey:yubikey:intro}"
msgstr ""
"Neki od servisa je zatražio da se autentifikujete. Da biste se "
"autentifikovali pritisnite dugme na vašem YubiKey uređaju. Nakon toga bi "
"u polje ispod trebala biti automatski upisana jednokratna lozinka."
msgid "{authYubiKey:yubikey:header}"
msgstr "Prijavite se pomoću YubiKey-a"
msgid ""
"Some service requested authentication. To authenticate, click the button "
"on your YubiKey. The field below should then automatically be filled out "
"with a secure one-time-password."
msgstr ""
"Neki od servisa je zatražio da se autentifikujete. Da biste se "
"autentifikovali pritisnite dugme na vašem YubiKey uređaju. Nakon toga bi "
"u polje ispod trebala biti automatski upisana jednokratna lozinka."
msgid "Login with YubiKey"
msgstr "Prijavite se pomoću YubiKey-a"
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: SimpleSAMLphp 1.15\n"
"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n"
"POT-Creation-Date: 2016-10-12 09:23+0200\n"
"PO-Revision-Date: 2016-10-14 12:14+0200\n"
"Last-Translator: \n"
"Language: sv\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
msgid "{authYubiKey:yubikey:intro}"
msgstr ""
"En tjänst vill att du ska logga in. För att logga in tryck på knappen på "
"din YubiKey. Fältet nedan ska när du trycker bli ifyllt med ett säkert "
"engångslösenord."
msgid "{authYubiKey:yubikey:header}"
msgstr "Logga in med YubiKey"
msgid ""
"Some service requested authentication. To authenticate, click the button "
"on your YubiKey. The field below should then automatically be filled out "
"with a secure one-time-password."
msgstr ""
"En tjänst vill att du ska logga in. För att logga in tryck på knappen på "
"din YubiKey. Fältet nedan ska när du trycker bli ifyllt med ett säkert "
"engångslösenord."
msgid "Login with YubiKey"
msgstr "Logga in med YubiKey"
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: SimpleSAMLphp 1.15\n"
"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n"
"POT-Creation-Date: 2016-10-12 09:23+0200\n"
"PO-Revision-Date: 2016-10-14 12:14+0200\n"
"Last-Translator: \n"
"Language: tr\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
msgid "{authYubiKey:yubikey:intro}"
msgstr ""
"Bazı servisler kimlik doğrulama istedi. Kimlik doğrulamak için, "
"YubiKey'iniz üzerindeki düğmeyi tıklayınız. Ondan sonra, güvenli bir tek "
"kullanımlık şifre aşağıdaki alanda otomatik olarak belirecektir."
msgid "{authYubiKey:yubikey:header}"
msgstr "YubiKey ile giriş"
msgid ""
"Some service requested authentication. To authenticate, click the button "
"on your YubiKey. The field below should then automatically be filled out "
"with a secure one-time-password."
msgstr ""
"Bazı servisler kimlik doğrulama istedi. Kimlik doğrulamak için, "
"YubiKey'iniz üzerindeki düğmeyi tıklayınız. Ondan sonra, güvenli bir tek "
"kullanımlık şifre aşağıdaki alanda otomatik olarak belirecektir."
msgid "Login with YubiKey"
msgstr "YubiKey ile giriş"
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: SimpleSAMLphp 1.15\n"
"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n"
"POT-Creation-Date: 2016-10-12 09:23+0200\n"
"PO-Revision-Date: 2016-10-14 12:14+0200\n"
"Last-Translator: \n"
"Language: zh_Hant_TW\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
msgid "{authYubiKey:yubikey:intro}"
msgstr "有些服務需要經過驗證,請點選 YubiKey 按鈕來進行驗證。接下來的字串應該要被自動地填寫入加密之一次性密碼(OTP)。"
msgid "{authYubiKey:yubikey:header}"
msgstr "使用 YubiKey 登入"
msgid ""
"Some service requested authentication. To authenticate, click the button "
"on your YubiKey. The field below should then automatically be filled out "
"with a secure one-time-password."
msgstr "有些服務需要經過驗證,請點選 YubiKey 按鈕來進行驗證。接下來的字串應該要被自動地填寫入加密之一次性密碼(OTP)。"
msgid "Login with YubiKey"
msgstr "使用 YubiKey 登入"
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: SimpleSAMLphp 1.15\n"
"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n"
"POT-Creation-Date: 2016-10-12 09:23+0200\n"
"PO-Revision-Date: 2016-10-14 12:14+0200\n"
"Last-Translator: \n"
"Language: zh\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
msgid "{authYubiKey:yubikey:intro}"
msgstr "某些服务请求认证。为了认证,请点击你的YubiKey按钮,下列区域应该会被自动填充成一次性安全密码"
msgid "{authYubiKey:yubikey:header}"
msgstr "使用YubiKey登录"
msgid ""
"Some service requested authentication. To authenticate, click the button "
"on your YubiKey. The field below should then automatically be filled out "
"with a secure one-time-password."
msgstr "某些服务请求认证。为了认证,请点击你的YubiKey按钮,下列区域应该会被自动填充成一次性安全密码"
msgid "Login with YubiKey"
msgstr "使用YubiKey登录"
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="tests/bootstrap.php">
<testsuites>
<testsuite name="The project's test suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./lib</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true" />
<log type="coverage-html" target="build/coverage" title="PHP Coveralls" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70" />
<log type="coverage-clover" target="build/logs/clover.xml" />
</logging>
</phpunit>
<?xml version="1.0"?>
<psalm
name="SimpleSAMLphp YubiKey Module"
useDocblockTypes="true"
totallyTyped="false"
>
<projectFiles>
<directory name="lib" />
<directory name="libextinc" />
<directory name="www" />
</projectFiles>
<issueHandlers>
<LessSpecificReturnType errorLevel="info" />
<!-- level 3 issues - slightly lazy code writing, but probably low false-negatives -->
<DeprecatedMethod errorLevel="info" />
<MissingClosureReturnType errorLevel="info" />
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<InvalidDocblock errorLevel="info" />
<MisplacedRequiredParam errorLevel="info" />
<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor errorLevel="info" />
<MissingClosureParamType errorLevel="info" />
<MissingParamType errorLevel="info" />
<UnusedClass errorLevel="info" />
<PossiblyUnusedMethod errorLevel="info" />
</issueHandlers>
</psalm>
<?php
$this->includeAtTemplateBase('includes/header.php');
if ($this->data['errorCode'] !== null) {
?>
<div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5">
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px" alt="" />
<h2><?php echo $this->t('{login:error_header}'); ?></h2>
<p><b><?php echo $this->t($this->data['errorcodes']['title'][$this->data['errorcode']]); ?></b></p>
<p><?php echo $this->t($this->data['errorcodes']['descr'][$this->data['errorcode']]); ?></p>
</div>
<?php
}
?>
<img style="float: right" src="<?php echo($this->data['logoUrl']); ?>" alt="" />
<img style="clear: right; float: right" src="<?php echo($this->data['devicepicUrl']); ?>" alt="YubiKey" />
<h2 style=""><?php echo $this->data['header']; ?></h2>
<form action="?" method="post" name="f">
<p><?php echo $this->t('{authYubiKey:yubikey:intro}'); ?></p>
<p><input id="otp" style="border: 1px solid #ccc; background: #eee; padding: .5em; font-size: medium; width: 70%; color: #aaa" type="text" tabindex="2" name="otp" /></p>
<?php
foreach ($this->data['stateParams'] as $name => $value) {
echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />';
}
?>
</form>
<?php
$this->includeAtTemplateBase('includes/footer.php');
{% set pagetitle = header|trans %}
{% extends "base.twig" %}
{% block preload %}
<link rel="stylesheet" href="/{{ baseurlpath }}module.php/authYubiKey/assets/css/yubikey.css">
{% endblock %}
{% block postload %}
<script src="/{{ baseurlpath }}module.php/authYubiKey/assets/js/autofocus.js"></script>
{% endblock %}
{% block content %}
{% if errorCode != null %}
<div class="message-box error">
<h3>{{ errorTitle }}</h3>
<p>{{ errorDesc }}</p>
</div>
{% endif %}
<img style="float: right" src="{{ logoUrl }}" alt="">
<img style="clear: right; float: right" src="{{ devicepicUrl }}" alt="YubiKey">
<h2>{{ '{authYubiKey:yubikey:header}'|trans }}</h2>
<form action="?" method="post" name="f">
<p>{{ '{authYubiKey:yubikey:intro}'|trans }}</p>
<p><input id="otp" type="text" tabindex="2" name="otp" autofocus></p>
{% for key, value in stateParams %}
<input type="hidden" name="{{ key|escape('html') }}" value="{{ value|escape('html') }}">
{% endfor %}
</form>
{% endblock %}
<?php
$projectRoot = dirname(__DIR__);
require_once($projectRoot.'/vendor/autoload.php');
// Symlink module into ssp vendor lib so that templates and urls can resolve correctly
$linkPath = $projectRoot.'/vendor/simplesamlphp/simplesamlphp/modules/authyubikey';
if (file_exists($linkPath) === false) {
echo "Linking '$linkPath' to '$projectRoot'\n";
symlink($projectRoot, $linkPath);
}
input#otp {
border: 1px solid #ccc;
background: #eee; padding: .5em;
font-size: medium;
width: 70%;
color: #aaa;
}
SimpleSAML_focus('otp');
vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/resources/logo.jpg

7.43 KiB

vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/resources/yubikey.jpg

3.24 KiB

<?php
/**
* This page shows a username/password login form, and passes information from it
* to the \SimpleSAML\Module\core\Auth\UserPassBase class, which is a generic class for
* username/password authentication.
*
* @author Olav Morken, UNINETT AS.
* @package SimpleSAMLphp
*/
if (!array_key_exists('AuthState', $_REQUEST)) {
throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.');
}
$authStateId = $_REQUEST['AuthState'];
$globalConfig = \SimpleSAML\Configuration::getInstance();
$t = new \SimpleSAML\XHTML\Template($globalConfig, 'authYubiKey:yubikeylogin.php');
$translator = $t->getTranslator();
$errorCode = [];
if (array_key_exists('otp', $_REQUEST)) {
// attempt to log in
$errorCode = \SimpleSAML\Module\authYubiKey\Auth\Source\YubiKey::handleLogin($authStateId, $_REQUEST['otp']) ?: $errorCode;
$errorCodes = \SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages();
if (array_key_exists($errorCode, $errorCodes['title'])) {
$t->data['errorTitle'] = $errorCodes['title'][$errorCode];
}
if (array_key_exists($errorCode, $errorCodes['desc'])) {
$t->data['errorDesc'] = $errorCodes['desc'][$errorCode];
}
}
$t->data['header'] = $translator->t('{authYubiKey:yubikey:header}');
$t->data['autofocus'] = 'otp';
$t->data['errorCode'] = $errorCode;
$t->data['stateParams'] = ['AuthState' => $authStateId];
$t->data['logoUrl'] = \SimpleSAML\Module::getModuleURL('authYubiKey/resources/logo.jpg');
$t->data['devicepicUrl'] = \SimpleSAML\Module::getModuleURL('authYubiKey/resources/yubikey.jpg');
$t->show();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment