Loading...
Loading...
Compare original and translation side by side
~/.asc/credentials.jsonasc~/.asc/credentials.jsonascasc auth login \
--key-id <KEY_ID> \
--issuer-id <ISSUER_ID> \
--private-key-path ~/.asc/AuthKey_KEYID.p8 \
[--name <alias>] # optional; defaults to "default"
[--vendor-number <number>] # optional; for sales/finance reports--namework-org--name"default"--private-key--private-key-path--vendor-numberAuthStatus{
"data": [{
"affordances": {
"check": "asc auth check",
"list": "asc auth list",
"login": "asc auth login --key-id <id> --issuer-id <id> --private-key-path <path>",
"logout": "asc auth logout"
},
"issuerID": "abc-def-456",
"keyID": "KEYID123",
"name": "work",
"source": "file"
}]
}asc auth login \
--key-id <KEY_ID> \
--issuer-id <ISSUER_ID> \
--private-key-path ~/.asc/AuthKey_KEYID.p8 \
[--name <alias>] # 可选;默认值为"default"
[--vendor-number <number>] # 可选;用于销售/财务报告--namework-org--name"default"--private-key--private-key-path--vendor-numberAuthStatus{
"data": [{
"affordances": {
"check": "asc auth check",
"list": "asc auth list",
"login": "asc auth login --key-id <id> --issuer-id <id> --private-key-path <path>",
"logout": "asc auth logout"
},
"issuerID": "abc-def-456",
"keyID": "KEYID123",
"name": "work",
"source": "file"
}]
}asc auth list [--pretty] [--output table]"isActive": true"use"ConnectAccount{
"data": [
{
"affordances": { "logout": "asc auth logout --name personal", "use": "asc auth use personal" },
"isActive": false, "issuerID": "...", "keyID": "KEYID1", "name": "personal"
},
{
"affordances": { "logout": "asc auth logout --name work" },
"isActive": true, "issuerID": "...", "keyID": "KEYID2", "name": "work"
}
]
}asc auth list [--pretty] [--output table]"isActive": true"use"ConnectAccount{
"data": [
{
"affordances": { "logout": "asc auth logout --name personal", "use": "asc auth use personal" },
"isActive": false, "issuerID": "...", "keyID": "KEYID1", "name": "personal"
},
{
"affordances": { "logout": "asc auth logout --name work" },
"isActive": true, "issuerID": "...", "keyID": "KEYID2", "name": "work"
}
]
}asc auth use <name>asc auth use <name>
Throws `accountNotFound` if `<name>` doesn't exist. Run `asc auth list` first to see valid names.
如果`<name>`不存在,会抛出`accountNotFound`错误。请先运行`asc auth list`查看有效账户名称。asc auth logout # removes the active account
asc auth logout --name work # removes a specific accountasc auth logout # 移除活跃账户
asc auth logout --name work # 移除指定账户undefinedundefinedasc auth update [--name <alias>] --vendor-number <number>--name--vendor-numbersales-reportsfinance-reportsaccountNotFoundAuthStatusvendorNumber{
"data": [{
"affordances": { "check": "asc auth check", "list": "asc auth list", ... },
"issuerID": "abc-def-456",
"keyID": "KEYID123",
"name": "work",
"source": "file",
"vendorNumber": "88012345"
}]
}asc auth update [--name <alias>] --vendor-number <number>--name--vendor-numbersales-reportsfinance-reportsaccountNotFoundvendorNumberAuthStatus{
"data": [{
"affordances": { "check": "asc auth check", "list": "asc auth list", ... },
"issuerID": "abc-def-456",
"keyID": "KEYID123",
"name": "work",
"source": "file",
"vendorNumber": "88012345"
}]
}asc auth check [--pretty] [--output table]"file""environment"vendorNumbernameasc auth check [--pretty] [--output table]"file""environment"vendorNumbernameasc~/.asc/credentials.jsonauth loginauth useASC_KEY_IDASC_ISSUER_IDASC_PRIVATE_KEY_PATHASC_PRIVATE_KEY_B64ASC_PRIVATE_KEYasc~/.asc/credentials.jsonauth loginauth useASC_KEY_IDASC_ISSUER_IDASC_PRIVATE_KEY_PATHASC_PRIVATE_KEY_B64ASC_PRIVATE_KEY{
"accounts": {
"personal": { "issuerID": "...", "keyID": "KEYID1", "privateKeyPEM": "..." },
"work": { "issuerID": "...", "keyID": "KEYID2", "privateKeyPEM": "...", "vendorNumber": "88012345" }
},
"active": "work"
}vendorNumbersales-reportsfinance-reports--vendor-number{ "keyID": ..., "issuerID": ..., "privateKeyPEM": ... }"default"{
"accounts": {
"personal": { "issuerID": "...", "keyID": "KEYID1", "privateKeyPEM": "..." },
"work": { "issuerID": "...", "keyID": "KEYID2", "privateKeyPEM": "...", "vendorNumber": "88012345" }
},
"active": "work"
}vendorNumber--vendor-numbersales-reportsfinance-reports{ "keyID": ..., "issuerID": ..., "privateKeyPEM": ... }"default"asc auth login \
--key-id KEYID123 \
--issuer-id abc-def-456 \
--private-key-path ~/.asc/AuthKey_KEYID123.p8
asc auth check --pretty # verify source: "file"
asc apps list # works without env varsasc auth login \
--key-id KEYID123 \
--issuer-id abc-def-456 \
--private-key-path ~/.asc/AuthKey_KEYID123.p8
asc auth check --pretty # 验证来源:"file"
asc apps list # 无需环境变量即可运行undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedasc auth list # find the name
asc auth logout --name personal
asc auth list # confirm removalasc auth list # 查找账户名称
asc auth logout --name personal
asc auth list # 确认已移除| Situation | Resolution |
|---|---|
| Run |
| Name contains spaces | Use hyphens/underscores: |
| 401 Unauthorized on API calls | Run |
| No credentials anywhere | Run |
| 场景 | 解决方法 |
|---|---|
| 运行 |
| 账户名称包含空格 | 使用连字符/下划线: |
| API调用返回401未授权 | 运行 |
| 无任何可用凭据 | 运行 |