Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net 8 Blazor Webassembly does not work with Dynamodb #3347

Closed
genifycom opened this issue Dec 20, 2023 · 3 comments
Closed

.Net 8 Blazor Webassembly does not work with Dynamodb #3347

genifycom opened this issue Dec 20, 2023 · 3 comments
Labels
bug This issue is a bug. dynamodb needs-reproduction This issue needs reproduction. p2 This is a standard priority issue

Comments

@genifycom
Copy link

A simple scan request in Blazor Webassembly .Net 8 gets an exception. The identical code works in .Net 6 Core.

    public static async Task<string> ScanRequest()
    {
        IAmazonDynamoDB _ddbClient = new AmazonDynamoDBClient(aws_access_key, aws_secret_key, RegionEndpoint.USEast1);

        var request = new ScanRequest
        {
            TableName = "mytable",
            Limit = 10
        };

        try
        {
            var response = await _ddbClient.ScanAsync(request);
        }
        catch (Exception ex)
        {
            var msg = ex.Message;
        }
        return "done";
    }

Create client succeeds, but the ScanAsync gives 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.'

@ashishdhingra ashishdhingra added bug This issue is a bug. needs-reproduction This issue needs reproduction. needs-review labels Jan 12, 2024
@ashishdhingra ashishdhingra added the p2 This is a standard priority issue label Jun 18, 2024
@ashishdhingra ashishdhingra transferred this issue from aws/dotnet Jun 18, 2024
@normj
Copy link
Member

normj commented Jun 18, 2024

Set the UseAlternateUserAgentHeader property to true. The user agent header is included as part of the signature but when you run in the browser with WebAssembly the browser changes the user agent string messing up the signature.

Amazon.AWSConfigs.UseAlternateUserAgentHeader = true;

Sorry this issue didn't come to my attention earlier. With the provided solution I'm going to close the issue assuming you haven't been waiting on this solution and hopefully found the answer somewhere else.

@normj normj closed this as completed Jun 18, 2024
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@genifycom
Copy link
Author

Thanks Norm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. dynamodb needs-reproduction This issue needs reproduction. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

4 participants