SignatureDoesNotMatch error response after forge deploy

Hello,

I am trying to deploy forge application, Custom UI, to my development environment. It was working in the past, but now I am receiving error responses for my JS and CSS files: HTTP/2 403 Forbidden.

I have removed all strings which may be related to my instance (I do not know what they are, it is just for sure) and replaced them with dots.

15:24:56.493 GEThttps://.....................................cdn.prod.atlassian-dev.net/css/app.b613a76c.css
[HTTP/2 403 Forbidden 15ms]

<?xml version="1.0" encoding="UTF-8"?>
    <Error>
    <Code>SignatureDoesNotMatch</Code>
    <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
    <AWSAccessKeyId>.......................</AWSAccessKeyId>
    <StringToSign>
        AWS4-HMAC-SHA256 
        20210423T132448Z
        20210423/us-west-2/s3/aws4_request
        ................................................................
    </StringToSign>
    <SignatureProvided>
        ................................................................
    </SignatureProvided>
    <StringToSignBytes>
        ....................
    </StringToSignBytes>
    <CanonicalRequest>
        GET /css/app.b613a76c.css
        host:.....................................cdn.prod.atlassian-dev.net
        x-amz-content-sha256:e..............................................................5
        x-amz-date:20210423T132448Z
        host;x-amz-content-sha256;x-amz-date

        e..............................................................5
    </CanonicalRequest>
    <CanonicalRequestBytes>
        ........................................
    </CanonicalRequestBytes>
    <RequestId>
        4..............P
    </RequestId>
    <HostId>g..........................................................................=</HostId>
</Error>


When using forge tunnel it works correctly.

Can, please, somebody give me any hints how to deploy the application? I do not know which steps should I try.

1 Like

The problem was with the base URL of my assets. If anybody will see similar error message, you should read this section: https://developer.atlassian.com/platform/forge/custom-ui/#accessing-static-assets

Since the static assets of a custom UI app are distributed via a URL with a particular path that identifies your app, you should use relative paths when accessing these assets from your custom UI app. For example, instead of including an image at "/assets/image.png" , you should use "./assets/image.png" .

If you’re using create-react-app

to generate your static assets (by creating a single-page React app), you can set "homepage": "." in your package.json to convert absolute paths into relative paths when bundling your app.

4 Likes