From 951309f76aab22e3742e8872bf0642fcea2570ae Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Sat, 19 May 2018 16:12:37 +0200 Subject: Add support for FIDO U2F (#3971) * Add support for U2F Signed-off-by: Jonas Franz * Add vendor library Add missing translations Signed-off-by: Jonas Franz * Minor improvements Signed-off-by: Jonas Franz * Add U2F support for Firefox, Chrome (Android) by introducing a custom JS library Add U2F error handling Signed-off-by: Jonas Franz * Add U2F login page to OAuth Signed-off-by: Jonas Franz * Move U2F user settings to a separate file Signed-off-by: Jonas Franz * Add unit tests for u2f model Renamed u2f table name Signed-off-by: Jonas Franz * Fix problems caused by refactoring Signed-off-by: Jonas Franz * Add U2F documentation Signed-off-by: Jonas Franz * Remove not needed console.log-s Signed-off-by: Jonas Franz * Add default values to app.ini.sample Add FIDO U2F to comparison Signed-off-by: Jonas Franz --- templates/base/footer.tmpl | 3 ++ templates/user/auth/u2f.tmpl | 22 +++++++++++ templates/user/auth/u2f_error.tmpl | 32 ++++++++++++++++ templates/user/settings/security.tmpl | 1 + templates/user/settings/security_openid.tmpl | 2 +- templates/user/settings/security_u2f.tmpl | 56 ++++++++++++++++++++++++++++ 6 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 templates/user/auth/u2f.tmpl create mode 100644 templates/user/auth/u2f_error.tmpl create mode 100644 templates/user/settings/security_u2f.tmpl (limited to 'templates') diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index c0f5a83d7b..3ad5358d41 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -64,6 +64,9 @@ {{if .RequireDropzone}} {{end}} +{{if .RequireU2F}} + +{{end}} {{if .RequireTribute}} diff --git a/templates/user/auth/u2f.tmpl b/templates/user/auth/u2f.tmpl new file mode 100644 index 0000000000..fa5904fc38 --- /dev/null +++ b/templates/user/auth/u2f.tmpl @@ -0,0 +1,22 @@ +{{template "base/head" .}} + +{{template "user/auth/u2f_error" .}} +{{template "base/footer" .}} diff --git a/templates/user/auth/u2f_error.tmpl b/templates/user/auth/u2f_error.tmpl new file mode 100644 index 0000000000..e30b064720 --- /dev/null +++ b/templates/user/auth/u2f_error.tmpl @@ -0,0 +1,32 @@ + diff --git a/templates/user/settings/security.tmpl b/templates/user/settings/security.tmpl index 8e7044f7df..c2c99c7979 100644 --- a/templates/user/settings/security.tmpl +++ b/templates/user/settings/security.tmpl @@ -4,6 +4,7 @@
{{template "base/alert" .}} {{template "user/settings/security_twofa" .}} + {{template "user/settings/security_u2f" .}} {{template "user/settings/security_accountlinks" .}} {{if .EnableOpenIDSignIn}} {{template "user/settings/security_openid" .}} diff --git a/templates/user/settings/security_openid.tmpl b/templates/user/settings/security_openid.tmpl index 82a05f3885..a16501acfa 100644 --- a/templates/user/settings/security_openid.tmpl +++ b/templates/user/settings/security_openid.tmpl @@ -43,7 +43,7 @@ {{.CsrfTokenHtml}}
- +
+
+
+ {{.Name}} +
+ + {{end}} + +
+ {{.CsrfTokenHtml}} +
+ + +
+ +
+ {{else}} + {{.i18n.Tr "settings.u2f_require_twofa"}} + {{end}} + + + + +{{template "user/auth/u2f_error" .}} + + + -- cgit v1.2.3