Commit Graph

40 Commits

Author SHA1 Message Date
Thomas Lamprecht
12f237de8b ui: dc/TFA Edit: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:14:51 +02:00
Thomas Lamprecht
53e3ea8488 ui: eslint: enforce "no-extra-parens" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:42:36 +01:00
Thomas Lamprecht
f6710aac38 ui: eslint: fix trailing comma and comma related whitespaces errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:31:03 +01:00
Thomas Lamprecht
e3aed879e4 ui: tfa/totp: fix setting issuer in secret URL
it's recommended to set the issuer for both, the get parameter and
the initial issuer label prefix[0].

[0]:
https://github.com/google/google-authenticator/wiki/Key-Uri-Format#label

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-18 16:29:51 +01:00
Thomas Lamprecht
3bbce3b8cd drop jslint lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 18:11:47 +02:00
Dominik Csapak
1011b56983 ui: fix missing htmlEncodes
username can include some special characters, so we have
to escape them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-06 16:59:50 +02:00
Dominik Csapak
49b54908ff gui: dc/TFAEdit: show an error message if tfa api call fails
setting the loadmask did not really work, so show a messagebox instead
and close the window

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-02-11 18:51:28 +01:00
Dominik Csapak
bfdfea5074 gui: TFAEdit: use viemodel binding for hiding/showing qr code
the verification textfield, and the selected tab.

also remove the code that used the value by the userview panel, since
this is the only way to have a consistent behaviour on the userview
setting and the usermenu tfa setting

this fixes the issue that on the 'user menu' we accidentally showed
the qr code and verification field, even if the user already had a
totp code

now it shows 'Unchanged' like when opened via dc/UserView

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-02-11 18:51:28 +01:00
Wolfgang Bumiller
7cfd876e34 ui: TFA: default to a 160 bit secret
This is base32, so we use only 5 bit per byte to make things simple,
so 32 byte * 5 bit/byte = 160 bit of entropy

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-10-29 09:43:02 +01:00
Wolfgang Bumiller
20ce59c33d ui: TFAEdit: use 'v2' secret format
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-10-29 08:41:07 +01:00
Thomas Lamprecht
ec5052600f js: fix some common typos found with codespell
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-15 10:44:43 +02:00
Dominik Csapak
5bb1062908 ui: TFAEdit: use new tfa api call
with the api call to userid/tfa we get the users tfa type as well
as the realm tfa type, so we can replace the call to the realm
with this

to properly show the loadmask, we want to initiate the api call when
the window is already shown, the 'show' event works for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-07 16:33:30 +00:00
Dominik Csapak
6dfb9ec490 ui: TFAEdit: change tfa_type default to null
If a dependency of a formula returns undefined, it will not get updated,
even if the other parts of the formula would work.

So we change the default to 'null' which gets handled differently,
but serves the same purpose for us.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-07 16:33:30 +00:00
Dominik Csapak
920d4deb05 ui: tfa: handle if TFA setup with no specific type set
if we have no info about TFA in the userview (x as key instead of
x!oath or x!u2f) we disabled the whole window and the only action
was to delete

instead show all options, so the user can overwrite the setting

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-17 12:59:51 +00:00
Thomas Lamprecht
1bfa058823 ui: tfa edit: fix initial state of delete button
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-16 14:32:03 +00:00
Thomas Lamprecht
b0184fc4cf tfa: disable, not mask, other cards if tfa is already setup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-16 07:54:05 +00:00
Thomas Lamprecht
72bff50c04 tfa: comment that TOTP secret is meant to be base32
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-16 07:53:27 +00:00
Wolfgang Bumiller
1b16f7138b ui: tfa: set initial tab based on current tfa type
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-16 07:02:05 +00:00
Wolfgang Bumiller
ac3daab801 ui: tfa: mask panels for not currently used types
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-16 07:02:05 +00:00
Thomas Lamprecht
2d41c7e6f2 ui: u2f: refactor error code map out and use in login window
to avoid showing numbers as error codes to users, even though the
strings are not much more helpful either...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-10 09:49:13 +02:00
Thomas Lamprecht
db2af54904 ui: tfa: add onlineHelp
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-08 17:31:03 +02:00
Thomas Lamprecht
cea0f76433 ui: tfa: also include validity check for password field
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-05 13:33:19 +02:00
Thomas Lamprecht
54416bb319 ui: tfa: use userid directly for totp url generation
as name is now a displayfield, which by default does not
gets submitted, so just use the fixed userid directly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-05 12:31:57 +02:00
Thomas Lamprecht
2f21247048 ui: tfa: show username as read only display field for info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-05 12:26:45 +02:00
Thomas Lamprecht
9390af7b1e ui: tfa: remove fixed labelwidth
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-05 12:26:22 +02:00
Dominik Csapak
0509c444e9 ui: tfa: allow apply only on valid inputs
only when the totp form and the challenge is valid, allow pressing the
apply button, default is disabled, as the 'user_tfa' data binding was
not used anywhere else replace it with something more fitting.

change allowBlank for the challenge

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-05 10:35:50 +02:00
Dominik Csapak
7bc701927e add a filter mask for the TFA Secret
this way a user cannot (easily) enter wrong characters
else if an invalid Character is entered, one can still hit apply
but not all characters will be used for the secret

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-05 09:20:47 +02:00
Thomas Lamprecht
0bc11f81f1 ui: tfa: fix secret validator
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 11:26:12 +02:00
Thomas Lamprecht
7b8d68fe5e ui: tfa: move qrcode creation to controller
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 10:07:25 +02:00
Thomas Lamprecht
6a1c9c29d2 ui: tfa: make lint happy, declare globals
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 09:31:27 +02:00
Thomas Lamprecht
aa8d628fc8 ui: tfa: also do not allow to delete TFA if not set
better UX

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 09:18:00 +02:00
Thomas Lamprecht
28ec45b20d ui: tfa: pregenerate secret if user has not setup TFA yet
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 09:09:38 +02:00
Thomas Lamprecht
2c2197a37e ui: tfa: hide digit/duration fields as some auth apps are broken
Google Authenticator, for example, just ignores it and thus one
cannot use they produced verification codes...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 08:35:28 +02:00
Thomas Lamprecht
31675561eb ui: tfa: follow up cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 08:34:50 +02:00
Thomas Lamprecht
0abfdbfa98 ui: tfa: s/Code/Verification Code/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 15:26:37 +02:00
Thomas Lamprecht
b688436d44 ui: tfa: ExtJS debug complains about - in references
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 15:26:37 +02:00
Thomas Lamprecht
34c08874de ui: tfa: make jsliunt a bit more happy
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 15:26:37 +02:00
Thomas Lamprecht
a8740316e3 ui: tfa: move randomize button right of secret field
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 15:26:37 +02:00
Thomas Lamprecht
ef50fb2903 ui: TFA: hide accout name
It's best to let this to the users real account name, it just
clutters the interface, an there's no real value in it.

One can already use the "issuer" field to add personalized info.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 15:26:37 +02:00
Wolfgang Bumiller
24d2ed8c27 ui: support u2f authentication and configuration
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 15:26:37 +02:00