azureazure-cdn

C# Sample for Generating AZURE V3 Token for premium CDN token authentication


On ASP.NET C# site need to generate Azure V3 tokens on the fly for premium CDN token authentication. Is the any API or some tool for that?


Solution

  • Found a Nugget for that.

    Sample use:

    const string PRIMARY_KEY = "abcd1234";
    
    var generator = new ecencryptstdlib.ECTokenGenerator();
    
    string token = generator.EncryptV3(PRIMARY_KEY, DateTime.Now.AddDays(1));