Giter Site home page Giter Site logo

Comments (4)

JoelAtDeluxe avatar JoelAtDeluxe commented on June 3, 2024

I can't reproduce this as indicated. If the server only has okta, then no local auth components will render.

I can get a similar error by including both ashirt and okta as valid authentication schemes, and then having a user with only okta auth, plus some additional steps below. We can probably just capture these errors and render a not available message.

steps to generate an error here:

  1. login with a user that has local auth (alternate: link a local auth with an okta-only user)
  2. go to account settings/authentication methods
  3. unlink local auth
  4. go to the account settings/security page

A refresh "fixes" this -- as noted above, only the components for the current set of auth schemes load. This only changes on refresh, so components will be out of sync until the user hits the refresh page button.

from ashirt-server.

JoelAtDeluxe avatar JoelAtDeluxe commented on June 3, 2024

On the backend, there's not a lot we can do without leaking user details. On the frontend, I will be putting up a PR that adds a friendlier error message in situations where the frontend thinks it should advertise multifactor auth, but for whatever reason, it cannot. In these cases, this error message will be displayed:
Multifactor Authentication is not available for this account. Please ensure you have linked ASHIRT local authentication. (given that this is only a local auth feature this should be a pretty safe message)

from ashirt-server.

jrozner avatar jrozner commented on June 3, 2024

The reason that it renders is that the user has a local auth scheme that was setup before the switch to only okta. If you add a local auth scheme in then change the auth schemes to only allow okta, the local auth scheme will still exist in the database and the backend will still return it when the /user endpoint is requested so it chooses to render that component.

Edit: one solution might be to filter out auth schemes from the database and only return the ones that are currently enabled for the /user endpoint. This maybe enough to stop the views from rendering.

from ashirt-server.

JoelAtDeluxe avatar JoelAtDeluxe commented on June 3, 2024

There are 2 PRs that address this issue.
PR #149 filters users that have auth scheme linked that are no longer supported. This should prevent the above situation from happening in those situatiions.
PR #148 provides a front end solution. Rather than displaying an error icon and vague error message, we instead display a simple message on error that indicates (As noted in a previous comment) that the feature is simply not available for the user.

from ashirt-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.