Has anyone had any success in accessing AWS S3 path-style request (https:<ama

Has anyone had any success in accessing AWS S3 path-style request (https:<amazon domain>/<path>) using Authorization (Access Key and Secret Access Key)?

I checked S3 documentation and bump into this: docs.aws.amazon.com/.../RESTAuthentication.html
Authorization = "AWS" + " " + AWSAccessKeyId + ":" + Signature;
Signature = Base64( HMAC-SHA1( YourSecretAccessKeyID, UTF-8-Encoding-Of( StringToSign ) ) );
StringToSign = HTTP-Verb + "\
" +
          Content-MD5 + "\
" +
          Content-Type + "\
" +
          Date + "\
" +
          CanonicalizedAmzHeaders +
          CanonicalizedResource;

I'm looking for HMAC Sha-1 in the available functions in Cryptography functions to generate the SIGNATURE as stated above but to no success. Please advise.

OriginalPostID-173296

OriginalPostID-173296

  Discussion posts and replies are publicly visible

Parents
  • I did this with the following code -

    calculaterfc2104hmac(
    ri!verb & char(
    10
    ) & if(
    isnull(
    ri!content
    ),
    "",
    md5hash(
    ri!content
    )
    ) & char(
    10
    ) & ri!contentType & char(
    10
    ) & char(
    10
    ) & if(
    isnull(
    ri!canonicalHeaders
    ),
    "",
    ri!canonicalHeaders & char(
    10
    )
    ) & "x-amz-date:" & ri!timestamp & char(
    10
    ) & ri!resource,
    cons!COMMON_AWS_SECRET_ACCESS_KEY
    )

    calculaterfc2104hmac is a custom function we wrote.....you can write your own plugin to calculate the hmac.
Reply
  • I did this with the following code -

    calculaterfc2104hmac(
    ri!verb & char(
    10
    ) & if(
    isnull(
    ri!content
    ),
    "",
    md5hash(
    ri!content
    )
    ) & char(
    10
    ) & ri!contentType & char(
    10
    ) & char(
    10
    ) & if(
    isnull(
    ri!canonicalHeaders
    ),
    "",
    ri!canonicalHeaders & char(
    10
    )
    ) & "x-amz-date:" & ri!timestamp & char(
    10
    ) & ri!resource,
    cons!COMMON_AWS_SECRET_ACCESS_KEY
    )

    calculaterfc2104hmac is a custom function we wrote.....you can write your own plugin to calculate the hmac.
Children
No Data