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

feat: Multifactor authentication #741

Merged
merged 212 commits into from
Mar 12, 2024
Merged

feat: Multifactor authentication #741

merged 212 commits into from
Mar 12, 2024

Conversation

sattvikc
Copy link
Collaborator

@sattvikc sattvikc commented Nov 13, 2023

Summary of change

(A few sentences about this PR)

Related issues

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates

  • Changelog has been updated
  • coreDriverInterfaceSupported.json file has been updated (if needed)
    • Along with the associated array in lib/ts/version.ts
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In package.json
    • In package-lock.json
    • In lib/ts/version.ts
  • Had run npm run build-pretty
  • Had installed and ran the pre-commit hook
  • If new thirdparty provider is added,
    • update switch statement in recipe/thirdparty/providers/configUtils.ts file, createProvider function.
    • add an icon on the user management dashboard.
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If have added a new web framework, update the add-ts-no-check.js file to include that
  • If added a new recipe / api interface, then make sure that the implementation of it uses NON arrow functions only (like someFunc: function () {..}).
  • If added a new recipe, then make sure to expose it inside the recipe folder present in the root of this repo. We also need to expose its types.

Remaining TODOs for this PR

  • Item 1

Tests

  • Test that usermetadata is automatically initialized if mfa is initialized

porcellus and others added 4 commits October 13, 2023 16:22
* feat: add (partial) initial types for MFA

* feat: expand the MFA recipe interface

* feat: add export point for mfa

* feat: update based on review discussions

* feat: add extra params to MFARequirements callbacks to help customizations

* feat: implement review feedback

* feat: implement review comments

* feat: implement review comments

* feat: stricter type for first factor/mfa requirement
* fix: type fix and account linking functions

* fix: cdi version update

* fix: more type updates

* fix: tests
@sattvikc sattvikc self-assigned this Nov 13, 2023
sattvikc and others added 4 commits November 16, 2023 17:00
* fix: type fix and account linking functions

* fix: cdi version update

* fix: more type updates

* fix: tests

* fix: totp recipe

* fix: totp types

* fix: update types

* fix: totp apis

* fix: user identifier info

* fix: recipe tests

* fix: test

* fix: pr comments

* fix: tests

* fix: PR comment
* fix: type fix and account linking functions

* fix: cdi version update

* fix: more type updates

* fix: tests

* fix: totp recipe

* fix: totp types

* fix: update types

* fix: totp apis

* fix: user identifier info

* fix: recipe tests

* fix: test

* fix: basic mfa impl

* fix: pr comments

* fix: tests

* fix: factors setup from other recipe

* fix: getFactorsSetupForUser impl

* fix: getMFARequirementsForAuth impl

* fix: isAllowedToSetupFactor impl

* fix: addToDefaultRequiredFactorsForUser and getDefaultRequiredFactorsForUser impl

* fix: typo

* fix: build next array

* fix: remove error file

* fix: factorSetupForUser refactor

* fix: next array

* fix: api impl

* fix: typo

* fix: isValidFirstFactorForTenant

* fix: impl

* fix: updated impl

* feat: fix and update mfa imlp to make all e2e tests pass

* fix: adds overwriteSessionDuringSignIn config in session

* fix: error messages in claims

* fix: cleanup

* fix: new errors for sign in up APIs

* fix: add error in totp

* fix: marked MFA TODOs

* fix: new param in createNewSession

* fix: impl cleanup

* fix: remove MFA_ERROR

* fix: cdi version

* fix: test fix

* fix: update/fix mfa impl to match e2e tests

* fix: pr comments

* fix: session user deleted error

* fix: adding cache to getUserById

* fix: get user cache

* caching in querier

* fix: mfa impl

* fix: email selection

* fix: mfa claims

* fix: remove unnecessary file

* fix: pr comment

* fix: PR comments

* fix: session handling

* fix: review comments

* fix: defaultRequiredFactorsForUser is now appwide

* fix: using accountlinking instead of mfa for primary user and link accounts

* fix: overwrite session flag refactor

* fix: race conditions in createOrUpdateSessionForMultifactorAuthAfterFactorCompletion

* fix: race conditions in createOrUpdateSessionForMultifactorAuthAfterFactorCompletion

* fix: recipe functions refactor

* fix: contact support case

* fix: unnecessary file

* fix: test

* refactor: added shouldRefetch + fetchValue building the next array into MFAclaim (#758)

* fix: usercontext type

* fix: test

* fix: test

* feat: add access token payload param to claim.build

* feat: expose addToDefaultRequiredFactorsForUser and remove tenantId param

* fix: remaining TODOs

* fix: auto init tests related to mfa

* fix: recipe function tests

* fix: create new session refactor

* fix: recipe interface refactor

* fix: userContext type fix

* fix: test

* fix: test

* fix: session

* fix: user context and support codes

* fix: type fixes after merge

* fix: test

* fix: pr comments

* fix: pr comment

* fix: test

* fix: available factors

* fix: updated user object

* fix: shouldAttemptAccountLinkingIfAllowed

* fix: missed types and test fixes

* fix: mfa fixes and tests

* fix: more tests

---------

Co-authored-by: Mihaly Lengyel <mihaly@lengyel.tech>
@sattvikc sattvikc changed the base branch from 16.5 to 16.6 December 15, 2023 13:27
lib/ts/types.ts Outdated Show resolved Hide resolved
lib/ts/index.ts Show resolved Hide resolved
lib/ts/recipe/accountlinking/utils.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/types.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/types.ts Outdated Show resolved Hide resolved
lib/ts/recipe/multifactorauth/recipe.ts Outdated Show resolved Hide resolved
lib/ts/recipe/multifactorauth/recipe.ts Outdated Show resolved Hide resolved
lib/ts/recipe/multifactorauth/recipe.ts Outdated Show resolved Hide resolved
lib/ts/recipe/multifactorauth/recipe.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/api/implementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/api/implementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/api/implementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/api/implementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/api/implementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/api/implementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/accountlinking/index.ts Outdated Show resolved Hide resolved
lib/ts/authUtils.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/types.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/types.ts Outdated Show resolved Hide resolved
lib/ts/recipe/emailpassword/types.ts Outdated Show resolved Hide resolved
lib/ts/recipe/thirdpartypasswordless/index.ts Outdated Show resolved Hide resolved
lib/ts/recipe/thirdpartypasswordless/index.ts Outdated Show resolved Hide resolved
lib/ts/recipe/totp/index.ts Show resolved Hide resolved
lib/ts/supertokens.ts Outdated Show resolved Hide resolved
lib/ts/supertokens.ts Show resolved Hide resolved
lib/ts/recipe/emailpassword/recipeImplementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/multitenancy/utils.ts Show resolved Hide resolved
lib/ts/querier.ts Outdated Show resolved Hide resolved
lib/ts/querier.ts Show resolved Hide resolved
lib/ts/recipe/multifactorauth/types.ts Outdated Show resolved Hide resolved
lib/ts/authUtils.ts Show resolved Hide resolved
lib/ts/recipe/accountlinking/recipe.ts Outdated Show resolved Hide resolved
lib/ts/recipe/passwordless/recipeImplementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/passwordless/index.ts Outdated Show resolved Hide resolved
lib/ts/recipe/passwordless/index.ts Outdated Show resolved Hide resolved
lib/ts/recipe/passwordless/api/implementation.ts Outdated Show resolved Hide resolved
lib/ts/recipe/thirdpartypasswordless/index.ts Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@rishabhpoddar rishabhpoddar marked this pull request as ready for review March 12, 2024 05:48
@rishabhpoddar rishabhpoddar merged commit 51e1ab2 into 16.7 Mar 12, 2024
5 of 15 checks passed
@rishabhpoddar rishabhpoddar deleted the feat/mfa/base branch March 12, 2024 05:49
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.

3 participants