Repository navigation
Importing users and totp credentials? #15334
|
How is keycloak storing the OTP seed in the database? I am migrating users over from ASPNET Core Identity. I have the original manual code / key / seed saved. (the same value as shown in the first image below). If I import that value I am unable to login with the authenticator app. Looking at what is actually stored by keycloak, I'm just not sure what conversion I need to do. For example, this code: Becomes this in the database: What steps do I need to take to go from one to the other so that I can successfully import all the users? Thanks |
Replies: 1 comment 10 replies
|
I can't give you an exact code for it, but basically the value that is imported in the authenticator app is a base 32 encoding of the secret value. The QR code also contains some other information like username and SSO name that you need to manually set when using the base32-encoded string that you mention. See this Google authenticator wiki page for more details. |
For anyone looking at a solution to this problem, see this thread. When migrating credentials, you need to create a new Keycloak endpoint (or have another method of using the Keycloak Admin Client) and then create the credential for a user as follows: