Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/totp default admin #111

Merged
merged 4 commits into from
Jul 14, 2020
Merged

Feature/totp default admin #111

merged 4 commits into from
Jul 14, 2020

Conversation

jack1902
Copy link

@jack1902 jack1902 commented Jul 5, 2020

to:
cc: @subspacecommunity/subspace-maintainers
related to:
resolves: #104

Background

Wanted to secure the default user of subspace with TOTP. Now it is possible to turn on TOTP for the default user by visiting /settings and scanning the QR code with your phone (or putting the secret key into something else)

Changes

  • Configure TOTP via /settings
  • Reset TOTP via /settings (only visible if TOTP is already configured)
  • Can only be done by an Admin (This means both SAML Signed in Admin and the default Admin)

Pics

Initial Setup of MFA
Setup MFA

Reset MFA (will then result in the above page)
reset totp

Sign in page for default admin account if TOTP has been saved
Sign in with MFA Configured

Testing

Ran this locally multiple times on my Droplet in Digital Ocean (i'm using rsync to sync changes to my box and then running docker-compose up --build -d whenever changes are made to go files. For changes related static files i simply specify --debug in the build step for go-bindata and mount web/ into the running container. go-bindata then reads these files live on each request :D)

@jack1902 jack1902 added the enhancement New feature or request label Jul 5, 2020
@jack1902 jack1902 self-assigned this Jul 5, 2020
@jack1902 jack1902 force-pushed the feature/totp_default_admin branch from db142cd to 8586b81 Compare July 5, 2020 20:00
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 5, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jack1902
Copy link
Author

jack1902 commented Jul 5, 2020

That force-push was to cause SonarCloud to re-trigger. i have disabled the warning about i vs em as using em causes the icons from Semantic-UI to disappear and i don't know what the workaround is

Copy link
Collaborator

@agonbar agonbar left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, I wanted to give a test in a local setup to be sure everything was fine, for the next iteration of the CI I think I need to focus on unit testing or something on the likes to save time.

The change is awseome @jack1902, thanks for all the work done ˆˆ.

@agonbar agonbar merged commit 0470100 into master Jul 14, 2020
@agonbar agonbar deleted the feature/totp_default_admin branch July 14, 2020 21:05
jack1902 added a commit that referenced this pull request Jul 17, 2020
jack1902 added a commit that referenced this pull request Jul 17, 2020
key, err := totp.Generate(
totp.GenerateOpts{
Issuer: httpHost,
AccountName: config.Info.Email,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here's the problem, it should be c.Info.Email not config

@maduggan
Copy link

maduggan commented Jul 7, 2021

I don't see this option when I go to settings, is there a flag or some way to enable this? I'd love to use it on my admin account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TOTP Support for the default Admin User
4 participants