search cancel

Cannot activated migrated users

book

Article ID: 240166

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

After migrating users from legacy portal, we have found out that a user cannot be activated without changing the username.

We have migrated the users , However, it seems that when activating such users (i.e. setting the password on the portal after receiving the activation email), if the user leaves the pre-filled original username migrated from the legacy portal, it results in error (code 487, username xxx is already in use).

After changing the username, activation is successful.

We do not want to change the username .

Environment

Release : 5.0.2

Component :

Resolution

The best option to bypass this is to transfer the old password from the 3.5 environment and set the user to enabled in de database after migration

In this case you do not have to send the reregistration email and also there is no need to change the user name

to do this :

If you migrate the users from 3.5 the username is migrated , the only thing which is not migrated  is the password.  

You can take the passwords from the 3.5 database 

Starting with CR6 of the 3.5 portal we changed from using SHA1 to using SHA512 to hash a users' password. SHA512 is the same algorithm used by the new portal.

Therefore if a user logged in to the portal after 3.5 CR6 was applied, the SHA512 hash and salt for the password would be created and stored in the cmsuser table. Therefore, it is possible for this hash and salt to be transferred to the USER_INFO table of the 5.0 portal database.

You can determine if the user's hash has been converted to SHA512 if there is non-null value in the hmackey column of the cmsusers table.

On 3.5 portal:

mysqldump lrs cmsusers > cmsusers.sql

On 5.0 portal:

mysql portal < cmsusers.sql

run in mysql the following commands 

ALTER TABLE temptable CONVERT TO character set utf8mb4 collate utf8mb4_0900_ai_ci;

update USER_INFO JOIN cmsusers on USER_INFO.USERNAME = cmsusers.username
SET STATUS = 'ENABLED',PASSWORD_SALT = cmsusers.hmacKey,PASSWORD_HASH = cmsusers.password
WHERE hmacKey is not null;

drop table cmsusers;

Now run a query to set the migrated users to ENABLED 

update USER_INFO set STATUS='ENABLED' where STATUS ='REGISTRATION_INIT';

The users can now  logon with the old username and password .