2017-07-15 124 views
0

當我嘗試通過郵遞員發送請求時。我面臨着一些問題。我在郵遞員設置這個在AWS認證: -AWS API網關:我們計算的請求籤名與您提供的簽名不匹配

訪問鍵: - XXXXXXXXXX

私有密鑰:-xxxxxxxxxx

AWS區域: - AP-南1

服務名稱: - execute-api「。

POSTGET我得到這個錯誤

{ "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.\n\nThe Canonical String for this request should have been\n'POST\n/dms/api/v1/filestore/file\n\ncontent-length:29940\ncontent-type:multipart/form-data\nhost:e7ffona9b4.execute-api.ap-south-1.amazonaws.com\nx-amz-date:20170714T111258Z\n\ncontent-length;content-type;host;x-amz-date\n15c77e9022d5c4e9de523e7279515d245695c76115ebabe7517119701f9ae963'\n\nThe String-to-Sign should have been\n'AWS4-HMAC-SHA256\n20170714T111258Z\n20170714/ap-south-1/execute-api/aws4_request\nb0e6151f24eb3a4aa5520da442bdafe7625a44ed7c15f3109eeb78eef038a6cd'\n" } 

我得到這個

{ "message": "No method found matching route api/v1/filestore/file for http method GET." } 

在我做了這樣的事情

@RestController 
@requestmapping(value = "/v1/filestore") 
public class FileUploadController { 

@Autowired 
private IFileStoreService fileStoreService; 

@CrossOrigin 
@ResponseBody 
@RequestMapping(value = "/file/{id}", method = RequestMethod.GET) 

,並在代碼個application.properties我設置

server.contextPath=/api 

如果我錯了,那麼請指引我正確的說法,幫我解決這個問題。

感謝

+0

你沒有檢查你的請求沒有安全? – Sergii

+0

是的,我做了這個,然後也出現了同樣的錯誤,但是當我選擇無驗證並嘗試點擊郵遞員獲取請求然後'{「消息」:「缺少驗證令牌」}'這出現。 –

+0

我的意思是沒有安全模塊在你的服務器。只需關閉安全性以簡化調試,比我們可以本地化問題 – Sergii

回答

0

仔細檢查這些:

  1. 你指定的對象不以期啓動的關鍵。

  2. 粘貼時不應該有任何不可見的字符。

  3. 嘗試編碼CopySource與encodeURIComponent()

+0

你正在談論哪個關鍵?這裏的CopySource是什麼? –

0

調試簽名的問題是很困難的,而且有可能涉及多個問題。縱觀你的描述,這裏有一個問題,我注意到...

在錯誤消息,你又回到使用郵遞員,我們有:

The request signature we calculated does not match the signature...The Canonical String for this request should have been...content-type:multipart/form-data...

API網關不支持也不正確處理multipart/form-data

相關問題