Needs review
Project:
TFA Migration
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2025 at 14:57 UTC
Updated:
22 Jan 2026 at 07:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bhanu951 commented@jibus what do you mean by recovery codes migration?
Aren't we doing it already?
Do you mean accepted codes?
Comment #3
jibus commentedHello @bhanu951
Yes, recovery codes !
Indeed, I see that this handle by the module. Weird, during my tests, recovery codes wasn't migrated.
I am gonna close the thread for now and continue my tests.
Sorry for that.
Comment #4
jibus commentedRe-open.
After checking the TFA User Settings migration process, it appears that the 'tfa_basic_recovery_code' plugin is migrated.
But the recovery codes are not.
This results in the user's TFA configuration contains the tfa_recovery_code plugin.
As a result, when the user logs in, he can use a recovery code plugin but since theses codes are not migrated the form cannot be displayed (the page reloads).
The recovery codes are in the 'tfa_recovery_code' table.
I don't know if we can migrate them. If not, the following code should be remove :
Comment #5
bhanu951 commentedI didn't get what you mean. Can you share screenshot?
Recovery codes are migrated and are present in users_data table.
If data is migrated properly you will get page to provide TFA code instead of message to setup TFA.
Comment #6
bhanu951 commentedHi @jibus can you share me sample data from Drupal 7 tfa_recovery_code table?
I don't have sample data or working Drupal 7 site to test the migration for recovery codes.
I wrote a draft version, need to test it.
You can share me 5-6 (or as many as you wish) sample data to process,
Comment #7
jibus commentedHi @bhanu951, of course - edit, please ignore double quotes
Comment #8
bhanu951 commentedCan you share actual schema data with all the fields data.
Are they grouped by uid or something?
Comment #9
jibus commentedI am sorry, please find the extract of the table.
Comment #10
bhanu951 commentedComment #11
bhanu951 commentedComment #13
bhanu951 commentedHi @jibus, I have pushed the changes, can you test it and let me know if it works ?
As I don't have your Drupal 7 private key I am unable to test decryption.
If the code doesn't work please share me your Drupal 7 private key and values of the backup codes from the site over slack.
So, I can test the decryption.
Comment #14
bhanu951 commented@jibus, I have made few more changes, now the migration of recovery codes would work properly.
Comment #15
jibus commented@bhanu951, sorry for the delay.
What's the command to import recovery code ?
?
Tried with tfa_migration_totp_seed && tfa_migration_user_settings. Got same results.
I copied the code from your merge request.
Comment #16
bhanu951 commented> What's the command to import recovery code ?
drush mim tfa_migration_recovery_codeIs the command to migrate recovery codes.
Comment #17
bhanu951 commented@jibus, just checking with you again , were you able to test it ?