Please excuse our look. We're just getting started here.

Want to learn more about Twilio Forums? Check out our FAQ page here.

Twilio sample seems to be missing a using...

edited April 4 in Twilio Community

Twilio provides a function used to compute a signature from this page (Security | Twilio - click on the C# tab) and that uses the following code:

 var hmac = new HMACSHA1(Encoding.UTF8.GetBytes(AuthToken));

However, the sample class does not include a using for System.Security.Cryptography but has a using Twilio.Securty. It seems that HMACSHA1 might be coming from the Twilio library. However, when I install the referenced Twilio NuGet package, HMACSHA1 in the line below is undefined. That leads me to think that it might actually be using System.Security... or that I am install the wrong NuGet package.

Can someone tell me which NuGet package to install for this? I have installed Twilio (Twilio REST API helper Library) and Twilio.AspNet.Core NuGet packages, but the sample code is only using Twilio.Securtiy. That suggests that the Twilio Sample is missing the using System.Security.Cryptography using... or I am using the wrong Twilio NuGet package.

My problem is that the sample code fails to product a valid signature using my Twilio Authentication token. So I'm trying to id what I am doing wrong. I thought it might be that I am using System.Security and not Twilio.Security for HMACSHA1.



  • Hi @jredmond33 , Twilio community manager here, I'd be happy to help you find a solution. Your best bet is to head over to the Twilio Collectives on Stack Overflow and ask your question there. There is a community of 1000 members that can help you! If you can't find help there I would head over to our Twilio Support page for further assistance.

    For your knowledge, Twilio Forums will be transitioning to Twilio Collectives and we will no longer be answering questions here. Please let me know if you have any questions or concerns about this transition.

If this is an emergency, please contact Twilio Support. This is not an official Support channel.
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support