ERROR 9425: Image access denied: This account doesn't have variant with this name

What’s wrong with me?

URL params (sig in this case) are added at the end with ? and then & as a separator. I believe right now it’s literally trying to find a variant named public&sig=98A21AAC14D2EDBB3010E1D2D85D3FF657EA6409FF9092CAF3890E8E1CB4B1DE

If you fix this then I get the following error:

This makes a lot more sense, make sure you generate the signature as specified here

For example, key is 111

The content is

The encrypted value is 1d160cf8c35752b652a3d5fc542634560e7a990091ea1073cd6fb42822f5a349. That’s right

But I c# got 4090da18a78252c31e4e43dbb89ec78e79a8d7db3199285ac1204c7043819eab

Is there a problem with the following code.

public static string Encrypt(string message, string secret)

        var encoding = new System.Text.UTF8Encoding();
        byte[] keyByte = encoding.GetBytes(secret);
        byte[] messageBytes = encoding.GetBytes(message);
        using (var hmacsha256 = new HMACSHA256(keyByte))
            byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < hashmessage.Length; i++)
            return builder.ToString();

I don’t know why I have a problem with c# encryption?

        string sig=  Encrypt("","111");

Looks like you’re generating the hash incorrectly. Per the example I sent you need to use the path + expiration time and then also provide expiration time in the final URL.

Here is an example URL:

How did I compute this hash? Well, it comes down to this:
You need the whole path (so, account ID, image ID, variant (if applicable) and the expiration time).
Then you will use your token as the secret key (you can get that here:

You can use a tool like Free HMAC-SHA256 Online Generator Tool | Devglan to test this and try to get a valid URL. Once you know your values are correct, you can put them into C#.

Let me know if you need anymore help!


This topic was automatically closed after 15 days. New replies are no longer allowed.