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

    Migrate user with its authenticator factor

    Scheduled Pinned Locked Moved
    General Discussion
    2
    3
    1.5k
    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.
    • E
      evgeniya.gabrikova
      last edited by

      Hi,

      I am trying to migrate users from my current db to fusionauth together with their two factor methods. All goes good appart of authenticator method. I am using Import Users API call and based on the documentation I need to specify in the authenticator method object its secret, name and configuration ( authenticator.algorithm, authenticator.codeLength, authenticator.timeStep ). For the secret prop I am using authenticator set up key ( also known as recovery key ). Migration procces is succesfull but on the login if I choose authenticator method it says Invalid code.

      In my current project I do store user totp_secret encrypted with cryptography.fernet py lib. When I do decrypt it manually with fernet token I get that authenticator set up key ( also known as recovery key ) and I am able to insert it manually to the google authenticator app and I see the same value as I will do it authomaticly by aplication that using this lib.

      What do I do wrong?

      E 1 Reply Last reply Reply Quote 0
      • E
        evgeniya.gabrikova @evgeniya.gabrikova
        last edited by

        @evgeniya-gabrikova Well, if anyone will struggle with the same topic, the solution is : the secret property of authenticator method should be the result of base32 decoded to base64 encoded authenticator set up key.

        danD 1 Reply Last reply Reply Quote 1
        • danD
          dan @evgeniya.gabrikova
          last edited by

          @evgeniya-gabrikova Thanks so much for coming back and sharing your solution!

          Avoids the "Wisdom of the Ancients" problem: https://xkcd.com/979/

          --
          FusionAuth - Auth for devs, built by devs.
          https://fusionauth.io

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