Use STS to access OSS - OSS Access Key Id you provided does not exist in our records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IvanH
    New Member
    • Nov 2017
    • 51

    Use STS to access OSS - OSS Access Key Id you provided does not exist in our records

    Hi,
    I'm trying to use STS to access OSS as described here. My scenario is following:
    1) Client react app calls FC Compute Function via API Gateway and submit some information
    2) Function validate the information and if it is ok then function calls sts.assumeRole and specify permission to GET* for all resources in OSS using AccessKeyId and AccessKeySecret of sub-account
    3) The new STS temporary token is created and it is returned to client
    4) Client initialize OSS client with returned AccessKeyId, AccessKeySecret and SecurityToken
    5) Client try to download selected file
    6) This error is thrown:
    Error: The OSS Access Key Id you provided does not exist in our records.
    at Client.requestE rror$ (aliyun-oss-sdk.js:619)
    at tryCatch (aliyun-oss-sdk.js:15266)
    at Generator.invok e [as _invoke] (aliyun-oss-sdk.js:15500)
    at Generator.proto type.(anonymous function) [as next] (http://localhost:3000/static/js/bundle.js:12651 6:21)
    at onFulfilled (aliyun-oss-sdk.js:6100)

    Is there something I'm doing wrong or there could be some problem on OSS?

    Thanks for any help,
    Marek
  • Andrea1701
    New Member
    • Nov 2017
    • 34

    #2
    Just like Stack Overflow, post your code is you need help with a software development issue.

    Include the policy that you are assuming.

    The key message is: The OSS Access Key Id you provided does not exist in our records.

    Check your code to make sure that you are passing the correct values received from STS to OSS unchanged. The security token is a very long string (base64 encoded credentials).

    Two tips that I do on problems like this. I check to make sure that my code works on public read files. Often I find silly mistakes with region handling, etc. Another test is to use normal credentials in-place of STS credentials to check my code. Once those two tests work and all error handling is in place, I then only have to debug the STS logic.

    Comment

    Working...