认证管理
管理认证、凭证和店铺连接。
login
通过 OAuth 2.0 登录 Shoplazza。
shoplazza auth login [参数]
参数
| 参数 | 类型 | 说明 |
|---|---|---|
--store-domain, -s <域名> | string | 要连接的店铺域名(如 my-store.myshoplaza.com) |
--domain <域> | StringSlice | 逗号分隔的业务域,用于作用域扩展(如 products,orders) |
--scope <作用域> | StringSlice | 逗号分隔的 OAuth 作用域(如 read_product,write_product) |
--uat <令牌> | string | 用户访问令牌,用于非交互式登录(CI/CD) |
--timeout <秒> | int | Web 流程轮询超时时间,单位秒(默认:300) |
--poll-interval <秒> | int | Web 流程轮询间隔,单位秒(默认:2) |
示例
# 浏览器交互式登录
shoplazza auth login --store-domain my-store.myshoplaza.com
# 指定业务域作用域登录
shoplazza auth login --store-domain my-store.myshoplaza.com --domain products,orders,customers
# CI/CD 非交互式登录
shoplazza auth login --uat $SHOPLAZZA_UAT --store-domain my-store.myshoplaza.com
logout
从操作系统钥匙链中移除所有存储的凭证。
shoplazza auth logout
status
显示当前认证状态,包括账户、店铺和已授权的作用域。
shoplazza auth status
scopes
列出所有可用的 OAuth 作用域。
shoplazza auth scopes
store use
切换活跃店铺,无需重新认证。
shoplazza auth store use [参数]
| 参数 | 类型 | 说明 |
|---|---|---|
--store-domain, -s <域名> | string | 要切换到的店铺域名 |