FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Is there any way to query for users that have 2FA enabled in the dashboard

    Scheduled Pinned Locked Moved
    General Discussion
    0
    5
    353
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      david.billings
      last edited by

      Is there a query I can run on the user search which will show me users with 2FA enabled?

      1 Reply Last reply Reply Quote 0
      • joshuaJ
        joshua
        last edited by

        @david-billings

        The MFA attributes were added recently to the elasticsearch index on a user. This should be available using an ES query in version 1.30.1 and greater.

        https://fusionauth.io/docs/v1/tech/release-notes/
        https://github.com/FusionAuth/fusionauth-issues/issues/1352
        https://fusionauth.io/docs/v1/tech/apis/users/#elasticsearch-search-engine

        the user will have a variation of these attributes

          "twoFactor" : {
            "methods" : [ {
              "authenticator" : {
                "algorithm" : "HmacSHA1",
                "codeLength" : 6,
                "timeStep" : 30
              },
              "id" : "HWV2",
              "method" : "authenticator"
            } ]
          },
        

        Thanks,
        Josh

        1 Reply Last reply Reply Quote 0
        • joshuaJ
          joshua
          last edited by

          To add a further note,

          You can search these attributes in the following manner

          twoFactor.methods.method:authenticator or twoFactor.methods.method:*

          in the Admin UI under users or using the Search API.

          Thanks,
          Josh

          1 Reply Last reply Reply Quote 1
          • joshuaJ
            joshua
            last edited by

            @david-billings,

            As a final note, you may want to upgrade to version 1.30.2 (just released) as we made some slight improvements as to the timing of when this MFA information is available in the ES index.

            Thanks,
            Josh

            1 Reply Last reply Reply Quote 0
            • D
              david.billings
              last edited by

              Perfect Joshua.

              This gives me what I need!

              Thank you!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post