Die MAC -Signatur ist nicht die gleiche wie jede berechnete Signatur mit Metadaten [geschlossen]C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Die MAC -Signatur ist nicht die gleiche wie jede berechnete Signatur mit Metadaten [geschlossen]

Post by Anonymous »

Ich verwende das Paket .NET azure.storage.Blobs in einer Azure -Funktion, um Blobs zu schreiben. Der Pfad ist dynamisch, daher verwende ich die Binder -Funktionalität. Ich biete auch Metadaten mit einem dynamischen Wert auf dem Blob ein. < /P>
public static async Task UploadFromStringAsync(
Microsoft.Azure.WebJobs.Binder binder,
string path, string assetId)
{
var blobBinder = new BlobAttribute(path, FileAccess.Write) { Connection = "StorageConnectionString" };
var reportBlob = await binder.BindAsync(blobBinder);
var metadata = new Dictionary { { "assetid", assetId } };
var uploadOptions = new BlobUploadOptions
{
HttpHeaders = new BlobHttpHeaders() { ContentType = "application/json" },
Metadata = metadata
};

string blobContents = "Sample blob data";
using (var memStream = CreateStream(blobContents))
{
await reportBlob.UploadAsync(memStream, uploadOptions);
}
}
< /code>
Für einen kleinen Teil von ihnen erhalte ich diesen Fehler: < /p>
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:
Time:2025-05-30T15:43:28.0147307Z
Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)
ErrorCode: AuthenticationFailed

Additional Information:
AuthenticationErrorDetail: The MAC signature found in the HTTP request '' is not the same as any computed signature.
< /code>
Warum bekomme ich diesen Fehler? Und warum ist es nur für einen kleinen Bruchteil der Uploads?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post