Skip to content

[ENG-12251] added two-factor auth for admin panel - #11929

Open
ihorsokhanexoft wants to merge 1 commit into
CenterForOpenScience:feature/pbs-26-18from
ihorsokhanexoft:feature/ENG-12251
Open

ihorsokhanexoft wants to merge 1 commit into
CenterForOpenScience:feature/pbs-26-18from
ihorsokhanexoft:feature/ENG-12251

Conversation

@ihorsokhanexoft

Copy link
Copy Markdown
Contributor

Ticket

https://openscience.atlassian.net/browse/ENG-12251

Changes

Admins can sign in into admin panel only by using correct email + password, having two-factor config enabled and confirmed + using a verification code for each log in

@brianjgeiger brianjgeiger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I'd like to change if we can.

Comment on lines +67 to +82
# to not lose creds after login request, we save them as initial values
# and use HiddenInput to not display them
if isinstance(form, LoginForm):
self.form_class = TwoFactorForm
return render(
request,
'two_factor.html',
{
'form': self.form_class(
initial={
'email': email,
'password': password
}
)
}
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me uncomfortable. Is it absolutely necessary that we re-auth the user when we do the two factor check? It might be better to accept that if someone leaves a partially logged-in page open and changes their password that they could still login if they have the two-factor. It seems better than transmitting the unencrypted password to the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants