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

UI: Fix MFA + SSO login workflow #28873

Merged
merged 17 commits into from
Dec 17, 2024

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Nov 10, 2024

Description

This PR fixes the MFA workflow for OIDC, Okta and SAML (enterprise only). Now users can enable MFA and log in to the Vault GUI with OIDC, Okta or SAML.

❌ Failures for MFA+SSO don't return very intuitive error messages and differ depending on the auth mount type. Screenshots are below for posterity and to help triage bug reports.

Test scenarios

OIDC SSO authenticator MFA method root child namespace cloud admin/ namespace
azure* TOTP
auth0* TOTP
okta TOTP
saml* (enterprise only) TOTP

*Tested with and without a configured default role

Auth0 Success

Screen.Recording.2024-11-13.at.2.41.19.PM.mov

Okta success, within a namespace

Screen.Recording.2024-12-12.at.1.37.11.PM.mov

❌ Errors

OIDC error (same for azure and auth0)

Authentication failed: role with oidc role_type is now allowed
Screenshot 2024-11-13 at 12 02 09 PM

Okta

The passcode failed to validate. If you entered the correct passcode, contact your administrator.
Screenshot 2024-12-12 at 1 32 34 PM error

SAML error

Unauthorized: request is unauthorized
Screenshot 2024-11-13 at 3 04 49 PM

TODO only if you're a HashiCorp employee

  • Backport Labels: If this PR is in the ENT repo and needs to be backported, backport
    to N, N-1, and N-2, using the backport/ent/x.x.x+ent labels. If this PR is in the CE repo, you should only backport to N, using the backport/x.x.x label, not the enterprise labels.
    • If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Nov 10, 2024
@hellobontempo hellobontempo changed the title UI: Fix MFA + SSO (OIDC, SAML) workflow UI: Fix MFA + SSO (OIDC, SAML) login workflow Nov 10, 2024
Copy link

github-actions bot commented Nov 10, 2024

CI Results:
All Go tests succeeded! ✅

@hellobontempo hellobontempo changed the title UI: Fix MFA + SSO (OIDC, SAML) login workflow UI: Fix MFA + SSO login workflow Nov 11, 2024
@hellobontempo hellobontempo marked this pull request as ready for review November 11, 2024 00:51
@hellobontempo hellobontempo requested review from a team as code owners November 11, 2024 00:51
Copy link

Build Results:
All builds succeeded! ✅

@hellobontempo
Copy link
Contributor Author

Screenshot 2024-11-10 at 4 59 39 PM

@hellobontempo hellobontempo added this to the 1.19.0-rc milestone Nov 11, 2024
ui: Fixes login to web UI when MFA is enabled for OIDC (i.e. azure, auth0) and Okta auth methods
```
```release-note:bug
ui (enterprise): Fixes login to web UI when MFA is enabled fr SAML methods
Copy link
Contributor

Choose a reason for hiding this comment

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

is "fr" supposed to be "for"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@@ -60,13 +60,32 @@ export default class AuthLoginFormComponent extends Component {
} else {
this.delayAuthMessageReminder.perform();
}

/*
Checking for an mfa_requirement happens in two places.
Copy link
Contributor

Choose a reason for hiding this comment

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

great comments!

Monkeychip
Monkeychip previously approved these changes Dec 16, 2024
Copy link
Contributor

@Monkeychip Monkeychip left a comment

Choose a reason for hiding this comment

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

Really great work; thoughtful pr description and test coverage!

changelog/28873.txt Outdated Show resolved Hide resolved
@hellobontempo
Copy link
Contributor Author

✅ enterprise passed
Screenshot 2024-12-17 at 11 06 02 AM

@hellobontempo hellobontempo merged commit 741721a into main Dec 17, 2024
32 of 33 checks passed
@hellobontempo hellobontempo deleted the ui/VAULT-19793/VAULT-30110/sso-mfa-fix branch December 17, 2024 17:06
Monkeychip pushed a commit that referenced this pull request Dec 18, 2024
* =passback mfa_requirement for oidc login methods

* =pass SAML mfa requirement

* add comments

* add acceptance tests

* add helper

* update callback args for auth jwt

* add changelog

* update changelog

* is this line necessary?

* fetch token data for display name, this commit can be undone when BE fixes VAULT-32462

* change error handling, add comments

* update capitalization

* revert capitalization

* reword changelog

* clarify comments

* Update changelog/28873.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.18.x hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants