---
title: "Comment by Belén Rodriguez Salazar on \"Generating TOTPs for CyberArk (now Idira) Privileged Session Manager Webapp Connectors using a PreConnect DLL\" | Hashnode"
description: "Hi, I have follow the steps from the article, however it doesn´t work, page responds saying that the code is invalid. Could it be because in the webformfields y"
url: "https://hashnode.com/posts/generating-totps-for-cyberark-privileged-session-manager-webapp-connectors-using-a-preconnect-dll/652817e761fd3a89becd3fe7/comment/65648173b4e3eb72c57ff222"
---

[Discussion](https://hashnode.com/posts/generating-totps-for-cyberark-privileged-session-manager-webapp-connectors-using-a-preconnect-dll/652817e761fd3a89becd3fe7)

Comment [Generating TOTPs for CyberArk (now Idira) Privileged Session Manager Webapp Connectors using a PreConnect DLL](https://hashnode.com/posts/generating-totps-for-cyberark-privileged-session-manager-webapp-connectors-using-a-preconnect-dll/652817e761fd3a89becd3fe7)

[Belén Rodriguez Salazar](https://hashnode.com/@beldruxs)

[Nov 27, 2023](https://hashnode.com/posts/generating-totps-for-cyberark-privileged-session-manager-webapp-connectors-using-a-preconnect-dll/652817e761fd3a89becd3fe7/comment/65648173b4e3eb72c57ff222)

Hi, I have follow the steps from the article, however it doesn´t work, page responds saying that the code is invalid. Could it be because in the webformfields you use MfaCode instead of MFACode as in the code?

[Tim Schindler](https://hashnode.com/@timschindler)

[Nov 27, 2023](https://hashnode.com/posts/generating-totps-for-cyberark-privileged-session-manager-webapp-connectors-using-a-preconnect-dll/652817e761fd3a89becd3fe7/comment/65648173b4e3eb72c57ff222#reply-6564deb5836b61ed3637256a)

What is the generated TOTP ? Is it actually an OTP? You can see this by injecting the OTP into a field that isn’t obscured, like the username field.

Failing that, can you generate a valid TOTP manually with the secret stored as the logon account’s password (when you show/copy the secret out of CyberArk?) When you generate it manually, is it the same as what the Preconnect DLL generates ?

If you have the ability to do so, you can clone the example code from GitHub, add debug logging, and recompile.
