Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[alibabacloud_cr20160607] get_authorization_token no data returned #7

Open
yongzhang opened this issue Mar 2, 2022 · 0 comments
Open

Comments

@yongzhang
Copy link

yongzhang commented Mar 2, 2022

Code:

#!/usr/bin/env python3

from alibabacloud_credentials.client import Client as CredClient
from alibabacloud_cr20160607.client import Client
from alibabacloud_tea_openapi.models import Config

config = Config(
    region_id="cn-shanghai",
    credential=CredClient()
)

client = Client(config)

response = client.get_authorization_token()
print (response.to_map())

I got headers only:

{'headers': {'date': 'Wed, 02 Mar 2022 09:59:39 GMT', 'content-type': 'application/json;charset=utf-8', 'content-length': '222', 'connection': 'keep-alive', 'access-control-allow-origin': '*', 'access-control-allow-methods': 'POST, GET, OPTIONS, PUT, DELETE', 'access-control-allow-headers': 'X-Requested-With, X-Sequence, _aop_secret, _aop_signature, x-acs-action, x-acs-version, x-acs-date, Content-Type', 'access-control-max-age': '172800', 'x-acs-request-id': 'requestid', 'x-acs-trace-id': 'id', 'server': 'Tengine', 'content-language': 'zh-CN'}}

But I can get the token by aliyun cli:

$ aliyun cr GetAuthorizationToken
{
        "data": {
                "authorizationToken": "xxxxx",
                "expireDate": 1646219005000,
                "tempUserName": "cr_temp_user"
        }
}

Please help, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant