Merge pull request #301 from clems4ever/fix-u2f-2

Fix U2F sign request after U2F library upgrade.
pull/293/head
Clément Michaud 2018-11-17 14:28:11 +01:00 committed by GitHub
commit 5f8e33d6ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 627 additions and 2288 deletions

View File

@ -86,8 +86,8 @@ regulation:
notifier:
# For testing purpose, notifications can be sent in a file
filesystem:
filename: /tmp/authelia/notification.txt
# filesystem:
# filename: /tmp/authelia/notification.txt
# Use your email account to send the notifications. You can use an app password.
# List of valid services can be found here: https://nodemailer.com/smtp/well-known/
@ -98,11 +98,11 @@ notifier:
## service: gmail
# Use a SMTP server for sending notifications
#smtp:
# username: test
# password: password
# secure: false
# host: 'smtp'
# port: 1025
# sender: admin@example.com
smtp:
username: test
password: password
secure: false
host: 'smtp'
port: 1025
sender: admin@example.com

2887
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -103,7 +103,7 @@
"jsdom": "^11.0.0",
"mocha": "^5.0.5",
"mockdate": "^2.0.1",
"nyc": "^11.6.0",
"nyc": "^13.1.0",
"power-assert": "^1.4.4",
"proxyquire": "^2.0.1",
"query-string": "^6.0.0",

View File

@ -31,8 +31,8 @@ export default function (vars: ServerVariables) {
vars.logger.debug(req, "AppId = %s, keyHandle = %s", appId, JSON.stringify(doc.registration.keyHandle));
const request = vars.u2f.request(appId, doc.registration.keyHandle);
res.json(request);
authSession.sign_request = request;
res.json(request);
return BluebirdPromise.resolve();
})
.catch(ErrorReplies.replyWithError200(req, res, vars.logger,

View File

@ -10,6 +10,7 @@ const includes = [
"docker-compose.test.yml",
"example/compose/docker-compose.base.yml",
"example/compose/nginx/minimal/docker-compose.yml",
"example/compose/smtp/docker-compose.yml",
]

View File

@ -1,5 +1,5 @@
import Bluebird = require("bluebird");
import loginAndRegisterTotp from "../helpers/login-and-register-totp";
import LoginAndRegisterTotp from "../helpers/login-and-register-totp";
import VisitPage from "../helpers/visit-page";
import FillLoginPageWithUserAndPasswordAndClick from "../helpers/fill-login-page-and-click";
import WithDriver from "../helpers/with-driver";
@ -12,7 +12,7 @@ describe("Keep me logged in", function() {
before(function() {
const that = this;
return loginAndRegisterTotp(this.driver, "john")
return LoginAndRegisterTotp(this.driver, "john", true)
.then(function(secret: string) {
that.secret = secret;
if(!secret) return Bluebird.reject(new Error("No secret!"));

View File

@ -10,6 +10,7 @@ const includes = [
"docker-compose.minimal.yml",
"example/compose/docker-compose.base.yml",
"example/compose/nginx/minimal/docker-compose.yml",
"example/compose/smtp/docker-compose.yml",
]

View File

@ -25,7 +25,7 @@ describe('Fail TOTP challenge', function() {
describe('successfully login as john', function() {
before(function() {
const that = this;
return LoginAndRegisterTotp(this.driver, "john");
return LoginAndRegisterTotp(this.driver, "john", true);
});
describe('fail second factor', function() {

View File

@ -14,7 +14,7 @@ describe('Registering TOTP', function() {
describe('successfully login as john', function() {
before('register successfully', function() {
this.timeout(10000);
return LoginAndRegisterTotp(this.driver, "john");
return LoginAndRegisterTotp(this.driver, "john", true);
})
it("should see generated qrcode", function() {

View File

@ -9,7 +9,7 @@ import ClickOnLink from '../helpers/click-on-link';
import ClickOnButton from '../helpers/click-on-button';
import WaitRedirect from '../helpers/wait-redirected';
import FillField from "../helpers/fill-field";
import {GetLinkFromFile} from "../helpers/get-identity-link";
import {GetLinkFromEmail} from "../helpers/get-identity-link";
import FillLoginPageAndClick from "../helpers/fill-login-page-and-click";
const execAsync = Bluebird.promisify(ChildProcess.exec);
@ -30,7 +30,7 @@ describe('Reset password', function() {
.then(() => FillField(this.driver, "username", "john"))
.then(() => ClickOnButton(this.driver, "Reset Password"))
.then(() => this.driver.sleep(1000)) // Simulate the time to read it from mailbox.
.then(() => GetLinkFromFile())
.then(() => GetLinkFromEmail())
.then((link) => VisitPage(this.driver, link))
.then(() => FillField(this.driver, "password1", "newpass"))
.then(() => FillField(this.driver, "password2", "newpass"))

View File

@ -24,7 +24,7 @@ describe('Validate TOTP factor', function() {
describe('successfully login as john', function() {
before(function() {
const that = this;
return LoginAndRegisterTotp(this.driver, "john")
return LoginAndRegisterTotp(this.driver, "john", true)
.then(function(secret: string) {
that.secret = secret;
})