Announcements

SecurID® Discussions

Browse the SecurID discussion board to get product help and collaborate with other SecurID users.
AbdelrahmanFawz
Beginner
Beginner

Sample code to distribute token with assigned activation code

anybody can help me with sample code to distribute token with assigned activation code   where i am getting the following error which trying to get activation code 

//zero (0) ctkip authcode found matching token serial number:<redacted>

 

                public CTKIPActivationCodeDTO getTokenActivationCode(String tokenSerialNumber) throws  Exception {

                LookupCTKIPActivationCodeCommand  activationCodeCommand = new                   LookupCTKIPActivationCodeCommand();

                activationCodeCommand.setTokenSerialNum(tokenSerialNumber);

                activationCodeCommand.execute();

                CTKIPActivationCodeDTO activationCodeDTO =  activationCodeCommand.getCtkipActivationCodeDTO();

                return activationCodeDTO;

                }

0 Likes
3 Replies
TedBarbour
Employee
Employee

Abdelrahman Fawzi‌ - did you create/set an activation code somewhere in your code?

The API does not automatically generate codes for you.

 

Hope that helps,

Ted

_EricaChalfin
Employee (Retired) Employee (Retired)
Employee (Retired)

Abdelrahman Fawzi‌,

 

I branched your question to a new thread since it is different from the initial question. 

 

Also, I redacted your token serial number from your code sample.  Posing sensitive information, such as token serial numbers on a public site such as RSA Link is not recommended. See https://community.rsa.com/community/products/securid/blog/2018/11/27/tips-for-posting-questions-to-the-rsa-securid-access-community for guidelines.

 

Regards,

Erica

0 Likes

Dear Ted,

i tried to  set the   activation codes  using the following code it doesn't work and  gives  COMMAND_EXECUTION_UNEXPECTED_ERROR

can you please provide me the code that set also how can i generate it the uniqueness of the activation code

 

AddCTKIPActivationCodeCommand activationCodeCommand = new AddCTKIPActivationCodeCommand();
CTKIPActivationCodeDTO activationCodeDTO = new CTKIPActivationCodeDTO();
activationCodeDTO.setTokenSerialNum(token.getSerialNumber());
activationCodeDTO.setActivationCode("002125542917");
activationCodeCommand.setActivationCode(activationCodeDTO);
activationCodeCommand.execute();

0 Likes