Skip to content

microsoft login #1 - #22

Open
Aryan1296 wants to merge 5 commits into
usarfoss:mainfrom
Aryan1296:main
Open

microsoft login #1#22
Aryan1296 wants to merge 5 commits into
usarfoss:mainfrom
Aryan1296:main

Conversation

@Aryan1296

Copy link
Copy Markdown

Feat: Add Microsoft Login and Two-Factor Authentication
This pull request significantly enhances the application's security and authentication capabilities. It introduces Microsoft Account as a new OAuth provider and implements a complete Two-Factor Authentication (2FA) system to provide users with an essential layer of security.

Problem

The application previously lacked a sufficient number of authentication options and was missing critical security features like 2FA. This limited user choice for logging in and left user accounts vulnerable to unauthorized access if their primary credentials were compromised.

Solution

This PR addresses these issues by implementing two major features:

Microsoft Authentication: Integrated the necessary Passport.js strategy to allow users to sign up and log in securely using their Microsoft accounts.

Two-Factor Authentication (2FA): A full 2FA system has been built from the ground up. This includes the logic for generating secrets, displaying QR codes for authenticator apps, verifying tokens, and providing one-time backup codes.

Key Changes

Microsoft OAuth Integration:

Added configuration and routes for the Microsoft authentication strategy.

Updated the login and signup pages to include a "Login with Microsoft" button.

New Security Controller:

Created controllers/security.js to handle all logic related to enabling/disabling 2FA and verifying codes.

New Account Management Views:

Added views/account/security.pug as a central hub for users to manage their security settings.

Created views/account/2-fac-setup.pug to guide users through the 2FA setup process with a QR code.

Implemented views/account/2-fac-prompt.pug which is shown after login to request the user's 2FA token.

Added views/bkup-codes.pug to display one-time backup codes for recovery.

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.

1 participant