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

    2FA

    Scheduled Pinned Locked Moved Unsolved Q&A
    4 Posts 2 Posters 1.8k Views 1 Watching
    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.
    • S
      stephen.saucier 0
      last edited by

      After I go through api/login with credentials of a user who has 2FA enabled, I get this response:

      {"methods":[{"id":"4ZF7","lastUsed":true,"method":"sms","mobilePhone":"17062259155"}],"twoFactorId":"ETCK_CQPo5ARy7SvrWC7vd4rC0ilbNRSc52pdE0rDd0"}
      

      I then immediately grab the method ID and twoFactorId from that and request that FA send a code to that two factor method, like so:

      curl -v
      -X POST 'https://fa.capital.dev.tranwall.net/api/two-factor/send/ETCK_CQPo5ARy7SvrWC7vd4rC0ilbNRSc52pdE0rDd0'
      -H 'Cookie: access_token=eyJhb...; refresh_token=Zzanp...'
      -H 'Accept: application/json, text/plain, */*'
      -H 'Content-Type: application/json'
      -d '{"methodId":"4ZF7"}'
      

      Unfortunately, this responds with a 400:

      {"fieldErrors":{"methodId":[{"code":"[invalid]methodId","message":"The [methodId] is not valid. No two-factor method with this Id was found enabled for the user."}]}}
      

      Why would the methodId be invalid, if it is given to me by FA in the first place?

      S 1 Reply Last reply
      Reply Quote 0
      • S
        stephen.saucier 0 @stephen.saucier 0
        last edited by

        My only option here has been to disable MFA for this user and have them enable it again on next login.

        EDIT: Sorry, I didn't add a good topic name. Maybe "Invalid methodID for MFA-enabled user".

        danD 1 Reply Last reply
        Reply Quote 0
        • danD
          dan @stephen.saucier 0
          last edited by

          @stephen-saucier-0

          Hmmm. What version of FusionAuth are you running? I looked at the code and this sequence should work fine.

          This certainly looks like it might be a bug. Would you mind filing an issue with details, including your version and a link to this forum post? https://github.com/fusionauth/fusionauth-issues/issues

          Thanks!

          --
          FusionAuth - Identity Without Constraints
          https://fusionauth.io

          S 1 Reply Last reply
          Reply Quote 0
          • S
            stephen.saucier 0 @dan
            last edited by

            @dan I have filed an issue here: https://github.com/FusionAuth/fusionauth-issues/issues/1627

            1 Reply Last reply
            Reply Quote 0
            • danD dan moved this topic from Q&A on
            • danD dan moved this topic from Frequently Asked Questions (FAQ) on

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post