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

2FA

Scheduled Pinned Locked Moved Unsolved
Q&A
2
4
415
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 24 Feb 2022, 20:58

    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 24 Feb 2022, 21:18 Reply Quote 0
    • S
      stephen.saucier 0 @stephen.saucier 0
      last edited by 24 Feb 2022, 21:18

      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".

      D 1 Reply Last reply 4 Mar 2022, 15:56 Reply Quote 0
      • D
        dan @stephen.saucier 0
        last edited by 4 Mar 2022, 15:56

        @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 - Auth for devs, built by devs.
        https://fusionauth.io

        S 1 Reply Last reply 8 Mar 2022, 20:45 Reply Quote 0
        • S
          stephen.saucier 0 @dan
          last edited by 8 Mar 2022, 20:45

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

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