Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
8 replies
Subscribers
7 subscribers
Views
3521 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Has anyone had any success in accessing AWS S3 path-style request (https:<ama
Jess
over 9 years ago
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
0
Tom Ryan
Appian Employee
over 9 years ago
By the cryptography functions I assume you mean one or both of these plugins?
forum.appian.com/.../summary
forum.appian.com/.../summary
Assuming that neither of these meet your requirements, you may need to create your own custom function
forum.appian.com/.../Custom_Function_Plug-ins.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jess
over 9 years ago
Hi Tom, thanks for the feedback, already saw those two set of functions and there's no available function HMAC signature..it's only for macsignature
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jess
over 9 years ago
On the other thought, HMACSha1 is available in the macsignature function. But still can;t generate correct signature. I think I'm passing a wrong STRING TO SIGN value in the parameter as mentioned above. Below is my rule to generate the signature part of the authentication header:
encodestringasbase64(macsignature("GET"& char(10) & "" & char(10) & "" & char(10) & gmt(now()) & "<file path>" & "",
<secret access key>,"HmacSHA1"))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tom Ryan
Appian Employee
over 9 years ago
To troubleshoot this further, you could check:
1. That the string you are passing into the macsignature() function is correct
2. The macsignature() function is returning the expected results - check that the JCA plugin is exposing the functionality you expect
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jess
over 9 years ago
actually, i think I'm passing invalid value in the string to sign parameter in macsignature() - "GET"& char(10) & "" & char(10) & "" & char(10) & gmt(now()) & "<file path>" & ""
Format: StringToSign = HTTP-Verb + "\
" +
Content-MD5 + "\
" +
Content-Type + "\
" +
Date + "\
" +
CanonicalizedAmzHeaders +
CanonicalizedResource;
Also, is there a function in appian to convert the value to UFT-8?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tom Ryan
Appian Employee
over 9 years ago
Have you tried using char(13) as well as/instead of char(10) ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jess
over 9 years ago
yup, have done that as well.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vikramb
over 9 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel