2017-10-27 17 views
1

미리 설정된 URL을 생성하고 유효성을 검사하는 python 스크립트가 있습니다. 이 스크립트는 내 랩톱에서 작동하지만 내 동료의 랩톱에서는 작동하지 않습니다. 오류 메시지는 AWS 보안 액세스 키와 서명 방법을 확인합니다. AWS 액세스/비밀 키는 유효하며 다른 AWS API에 액세스하는 데 사용할 수 있습니다. 더 이상 문제를 해결하려면 어떻게해야합니까?aws presigned url - 미리 설정된 url을 확인하면 SignatureDoesNotMatch 오류가 발생합니다.

import requests 
import boto3 

url = boto3.client('sts').generate_presigned_url(
    'get_caller_identity', 
    Params={}, 
    ExpiresIn=300) 
r = requests.post(url) 
print r.status_code 
print r.text 

오류 응답 : -

<ErrorResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> 
    <Error> 
    <Type>Sender</Type> 
    <Code>SignatureDoesNotMatch</Code> 
    <Message>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.</Message> 
    </Error> 
</ErrorResponse> 
+2

두 시스템 모두 boto3 및 botocore의 최신 버전이 있습니까? – jarmod

+0

'requests.post (url)'... 실제 서비스에 대한 API 참조는'POST'가 요청 본문을 가지고 있음을 나타냅니다. http://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html –

+0

@jarmod - 그게 전부입니다. boto3이 1.4.7 일 때 오류가 발생하는 것 같습니다 (boto3 == 1.4.7, botocore == 1.7.36). boto3이 1.4.1 일 때 제대로 작동합니다 (boto3 == 1.4.1, botocore == 1.4.69). 동의 할 수 있도록 답변으로 추가하십시오. – user1573133

답변

0

귀하의 코드가 나에게 잘 보인다.

두 시스템 모두 boto3 및 botocore의 최신 버전이 있습니까?

+0

그게 전부 였어. boto3이 1.4.7 일 때 오류가 발생하는 것 같습니다 (boto3 == 1.4.7, botocore == 1.7.36). boto3이 1.4.1 일 때 제대로 작동합니다 (boto3 == 1.4.1, botocore == 1.4.69). – user1573133

관련 문제