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 addition: Multi-Factor Authentication #163

Closed
wants to merge 65 commits into from
Closed

Conversation

chesspro13
Copy link

@chesspro13 chesspro13 commented May 27, 2024

Features added

  • TOTP (Time-based One-Time Password) with recovery codes
  • OAuth/OpenID sign on

To test TOTP:
You will need some sort of authentication app/extension prior to testing.

  1. Go to "Options" -> "MFA"
  2. Check the "Enable TOTP" checkbox
  3. Click the "Generate TOTP Secret" button
  4. Copy the generated secret to your authentication app/extension
  5. Click the "Generate Recovery Codes" button
  6. Copy the recovery codes. Recovery codes can only be used once in place of TOTP and will say the date/time they were used in zulu time on subsequent visits to this page.
  7. Save the secret in .env under "TOTP_SECRET"
  8. Restart trilium.
  9. Logout or navigate to login page. You can now use the TOTP or recovery codes to login.

To test Oauth/OpenID
You will need to setup a authentication provider. I tested with Authentik, Google, and 0Auth. This requires a bit of extra setup. Linked here is how to test this with Google.

  1. Setup Google or another provider. The key bits of information needed are
  1. Go to "Options" -> "MFA"
  2. Check the "Enable Oauth/OpenID" checkbox
  3. Click the "Login to Configured OAuth Service" button. It should redirect you to the authentication provider.
  4. When you are redirected back, click the "Save User" button. It should show a toast with the user you logged in as for your provider.
  5. You can now login and out with the service provider and should be able to login and logout without using your password.

@chesspro13 chesspro13 marked this pull request as draft May 31, 2024 23:52
@eliandoran eliandoran force-pushed the develop branch 5 times, most recently from eff61af to 4090386 Compare August 10, 2024 11:14
@eliandoran
Copy link

@chesspro13 , why close the PR?

@chesspro13
Copy link
Author

@eliandoran I had trouble making it merge with develop, so I started fresh on a new branch. PR #401 is the successor.

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.

4 participants