Help with AWS4 Signature Expird is Now earlier

Hi every one

i need some Help to generate Aws4 signature i add Loli Code by Ruri Topic HERE

and make change with 5 VARIABLES WITH my Config but still get this error i don’t KN where is my mistake so i wish that i get help

this my error msg

{"message":"Signature expired: 20220627T140551Z is now earlier than 20220627T190225Z (20220627T190725Z - 5 min.)"}

and this other error msg in header

InvalidSignatureException

now After many checking and fixing some mistake i get this new error

The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method.

For youe kind information, this not signature. Its signing part key, using the key only you need to make the signature.
Don’t consider the output as signature, you won’t get success.

If you need help on it specifically pm me

1 Like

This is my Aws4 signature bro

Authorization: AWS4-HMAC-SHA256 Credential=ASIAXVBM6XQBVYZKTT4C/20220628/eu-west-1/lambda/aws4_request, SignedHeaders=host;x-amz-client-context;x-amz-date;x-amz-invocation-type;x-amz-log-type;x-amz-security-token, Signature=bf29eb5186b21df13e554c17e0486c7beef0f30612caf007903e33b463796dc2

so you said that i need only to generate signature from secret key
what about other variable as @Ruri explain need to add all secript and change 4 variables ???

If the dates don’t match, AWS rejects the request, even if the time stamp is only seconds away from the date in the credential scope. For example, AWS will reject a request that has an x-amz-date header value of 20151014T235959Z and a credential scope that has the date 20151015.

this code Shall definitely work for you

INTERPRETER:NodeJS
INPUT 
BEGIN SCRIPT
const UTC = new Date().toISOString();
console.log(UTC);
END SCRIPT
OUTPUT String @UTC
ENDBLOCK

BLOCK:Replace
  original = @UTC
  toReplace = ":"
  => VAR @UTC1
ENDBLOCK

BLOCK:Replace
  original = @UTC1
  toReplace = "-"
  => VAR @UTC2
ENDBLOCK

BLOCK:RegexReplace
  original = @UTC2
  pattern = "\\.([^^]*)"
  replacement = "Z"
  => VAR @AMZDATE
ENDBLOCK
1 Like

PS: you need NodeJS installed.

Since this Date changes on Daily basis, use this Code for it

BLOCK:CurrentUnixTime
  => VAR @TS
ENDBLOCK

BLOCK:UnixTimeToDate
  unixTime = @TS
  format = "yyyyMMdd"
  => VAR @TSA
ENDBLOCK
1 Like

thank you so much @FairyRoot i fixed all this mistake about data before so need to go the next setp…

need to add string to sign
as here @FairyRoot

StringToSign =
    Algorithm + \n +
    RequestDateTime + \n +
    CredentialScope + \n +
    HashedCanonicalRequest

please if you can help me with this also

Refer to this URL

aHR0cHM6Ly9kb2NzLmF3cy5hbWF6b24uY29tL2dlbmVyYWwvbGF0ZXN0L2dyL3NpZ3Y0LXNpZ25lZC1yZXF1ZXN0LWV4YW1wbGVzLmh0bWwjc2lnLXY0LWV4YW1wbGVzLXBvc3Q=

It is base64 encode so it won’t flag the forums.
Decode the URL using any online base64 decode.

2 Likes

Were you able to fix it, currently having the same issue

its coganito ? Aws amazon

Cognito and AwS4 signature type both not same ! @PaleGreenFILE