# @adobe/aio-cli-plugin-auth 中文文档

规范地址：https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/

版本：4\.1\.0
npm 元数据更新时间：2026-10-01T01:32:06.419Z
中文译文更新时间：2026-11-05T20:42:37.233Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40adobe/aio-cli-plugin-auth
原文对照：https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/?lang=original
项目主页：https://github.com/adobe/aio-cli-plugin-auth
源码仓库：https://github.com/adobe/aio-cli-plugin-auth

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：50.6 kB，9 个文件
- TypeScript 类型：未声明
- Node.js 要求：\>=20
- 运行依赖：8 个
- 首次发布：2020-01-02T04:54:25.625Z
- 最新版本发布：2026-05-07T16:06:02.703Z
- 近 30 天下载量：25067（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：33（近 12 个月 1 个）

## 中文简介

IMS到aio的插件支持管理 IMS 的令牌,例如登录,登录,以及检索和使用令牌等.

## 安装

```sh
npm install @adobe/aio-cli-plugin-auth
```

也可以使用：`pnpm add @adobe/aio-cli-plugin-auth`、`yarn add @adobe/aio-cli-plugin-auth`、`bun add @adobe/aio-cli-plugin-auth`

## README

# 亚欧-克利-插头-欧斯

Adobe I/O CLI 的 Auth 插件支持对 Adobe 身份管理服务(IMS)的管理令牌,例如登录,登录,以及检索和使用令牌等.

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io/) [![Version](https://img.shields.io/npm/v/@adobe/aio-cli-plugin-auth.svg)](https://npmjs.org/package/@adobe/aio-cli-plugin-auth) [![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-cli-plugin-auth.svg)](https://npmjs.org/package/@adobe/aio-cli-plugin-auth) [![Node.js CI](https://github.com/adobe/aio-cli-plugin-auth/actions/workflows/node.js.yml/badge.svg)](https://github.com/adobe/aio-cli-plugin-auth/actions/workflows/node.js.yml) [![License](https://img.shields.io/npm/l/@adobe/aio-cli-plugin-auth.svg)](https://github.com/adobe/aio-cli-plugin-auth/blob/master/package.json) [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-cli-plugin-auth/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-cli-plugin-auth/)

-   [依赖关系](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-dependencies)
-   [动机](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-motivation)
-   [Java脚本套件](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-the-javascript-packages)
-   [如何运作](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-how-it-works)
-   [使用量](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-usage)
-   [图标](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-commands)
-   [捐款](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-contributing)
-   [许可证发放](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-licensing)

# 依赖关系

| 模块 | 版本 | 下载 | 构建状态 | 覆盖范围 | 问题 | 调取请求 |
| --- | --- | --- | --- | --- | --- | --- |
| [@adobe/aio-lib-ims (英语)](https://github.com/adobe/aio-lib-ims) | [![Version](https://img.shields.io/npm/v/@adobe/aio-lib-ims.svg)](https://npmjs.org/package/@adobe/aio-lib-ims) | [![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-ims.svg)](https://npmjs.org/package/@adobe/aio-lib-ims) | [![Node.js CI](https://github.com/adobe/aio-lib-ims/actions/workflows/node.js.yml/badge.svg)](https://github.com/adobe/aio-lib-ims/actions/workflows/node.js.yml) | [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-ims/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-ims/) | [![Github Issues](https://img.shields.io/github/issues/adobe/aio-lib-ims.svg)](https://github.com/adobe/aio-lib-ims/issues) | [![Github Pull Requests](https://img.shields.io/github/issues-pr/adobe/aio-lib-ims.svg)](https://github.com/adobe/aio-lib-ims/pulls) |
| [@adobe/aio-lib-ims-jwt](https://github.com/adobe/aio-lib-ims-jwt) | [![Version](https://img.shields.io/npm/v/@adobe/aio-lib-ims-jwt.svg)](https://npmjs.org/package/@adobe/aio-lib-ims-jwt) | [![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-ims-jwt.svg)](https://npmjs.org/package/@adobe/aio-lib-ims-jwt) | [![Node.js CI](https://github.com/adobe/aio-lib-ims-jwt/actions/workflows/node.js.yml/badge.svg)](https://github.com/adobe/aio-lib-ims-jwt/actions/workflows/node.js.yml) | [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-ims-jwt/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-ims-jwt/) | [![Github Issues](https://img.shields.io/github/issues/adobe/aio-lib-ims-jwt.svg)](https://github.com/adobe/aio-lib-ims-jwt/issues) | [![Github Pull Requests](https://img.shields.io/github/issues-pr/adobe/aio-lib-ims-jwt.svg)](https://github.com/adobe/aio-lib-ims-jwt/pulls) |
| [@adobe/aio-lib-ims-oauth (英语)](https://github.com/adobe/aio-lib-ims-oauth) | [![Version](https://img.shields.io/npm/v/@adobe/aio-lib-ims-oauth.svg)](https://npmjs.org/package/@adobe/aio-lib-ims-oauth) | [![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-ims-oauth.svg)](https://npmjs.org/package/@adobe/aio-lib-ims-oauth) | [![Node.js CI](https://github.com/adobe/aio-lib-ims-oauth/actions/workflows/node.js.yml/badge.svg)](https://github.com/adobe/aio-lib-ims-oauth/actions/workflows/node.js.yml) | [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-ims-oauth/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-ims-oauth/) | [![Github Issues](https://img.shields.io/github/issues/adobe/aio-lib-ims-oauth.svg)](https://github.com/adobe/aio-lib-ims-oauth/issues) | [![Github Pull Requests](https://img.shields.io/github/issues-pr/adobe/aio-lib-ims-oauth.svg)](https://github.com/adobe/aio-lib-ims-oauth/pulls) |

# 动机

这个插件为认证提供了Adobe IMS支持.

此插件支持 :

-   证书的多重配置
-   支持多个认证类型(JWT, OAuth2( 三脚通过浏览器))
-   对认证插件的支持(即服务符号支持)

# Java脚本套件

Adobe IMS 支持插件的收藏 :

-   这个 [Adobe I/O Lib 核心IMS支助图书馆](https://github.com/adobe/aio-lib-ims) 是可重复使用的基础库,为 Adobe IMS API 提供 JavaScript 级别 API ,以及获取对令牌的访问。 这个图书馆的所有功能都可以通过简单地要求这个图书馆而获得.
-   这个 [Adobe I/O CLI Auth 插件](https://github.com/adobe/aio-cli-plugin-auth) 是 Adobe IO CLI 的主要认证插件.
-   2个延期 _Adobe I/O IMS 支持图书馆_ 支持为不同的使用案例创建IMS标志. 他们都是作为节点包来的. 它们被 _Adobe I/O IMS 支持图书馆_ 以实施访问符创建。 插件为:
    -   这个 [Adobe I/O Lib 核心IMS图书馆 JWT 支持](https://github.com/adobe/aio-lib-ims-jwt) 支持生成和交换 JWT Tokens 的访问符号.
    -   这个 [Adobe I/O Lib 核心 IMS 库 OAuth2 支持](https://github.com/adobe/aio-lib-ims-oauth) 支持使用基于普通浏览器的SUSI流创建符. Adobe I/O CLI将推出一个网站,将用户重定向到IMS登录,成功登录后,访问令牌会返回CLI.

# 如何运作

这个 _Adobe IO CLI Auth 插件_ 提供三个命令:

-   [`login`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-imslogin) 创建并返回 Adobe IMS 访问符。 由于代号被缓存在Adobe IO CLI配置中,只有在目前被缓存的代号已经过期(或即将在10分钟内到期)的情况下才会创建出一个实际代号.
-   [`logout`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-imslogout) 取消缓存的快取符并把它们从缓存中删除。 除了访问令牌,这也可用于使任何可能被缓存的刷新令牌无效.
-   [`ctx`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-imsctx) 用于管理配置环境.

# 使用量

```
$ aio plugins:install -g @adobe/aio-cli-plugin-auth
$ # OR
$ aio discover -i
$ aio auth --help
```

# 图标

-   [`aio auth`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-auth)
-   [`aio auth ctx`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-auth-ctx)
-   [`aio auth login`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-auth-login)
-   [`aio auth logout`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-auth-logout)
-   [`aio context`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-context)
-   [`aio ctx`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-ctx)
-   [`aio login`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-login)
-   [`aio logout`](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/#readme-aio-logout)

## `aio auth`

Adobe IMS 命令登录和登录.

```
USAGE
  $ aio auth

DESCRIPTION
  Adobe IMS commands to login and logout.

  The main commands are `auth login` to get or create an access token and
  `auth logout` to invalidate an access token and thus log out from Adobe IMS.

  Logging in and out is based on configuration of which there may be
  multiple. Each set of configuration properties, called an Adobe IMS context,
  can be individually addressed by a label.

  Configuration for the Adobe IMS commands is stored in the "ims"
  configuration property. The special property "ims.config.current" contains the
  label of the current configuration which can be set using the
  "aio auth ctx -s <label>" command.

  Each set of properties in a labeled Adobe IMS context configurations has
  configuration properties depending on the kind of access that is
  supported. The below example shows the configuration for OAuth2
  based (graphical SUSI) login.

  The "env" property is optional and designates the Adobe IMS environment
  used for authentication. Possible values are "stage" and "prod".
  If the property is missing or any other value, it defaults to "prod".

  All commands allow their normal output to be formatted in either
  HJSON (default), JSON, or YAML.


EXAMPLES
  {
      ims: {
        contexts: {
          postman: {
            env: "stage",
            callback_url: "https://callback.example.com",
            client_id: "example.com-client-id",
            client_secret: "XXXXXXXX",
            scope: "openid AdobeID additional_info.projectedProductContext read_organizations",
            state: ""
          }
        },
        config: {
          current: "postman"
        }
      }
    }
```

_参见代码 : [src/commands/auth/index.js (中文(简体) )](https://github.com/adobe/aio-cli-plugin-auth/blob/4.1.0/src/commands/auth/index.js)_

## `aio auth ctx`

管理 Adobe IMS 上下文 .

```
USAGE
  $ aio auth ctx [--debug <value>] [-v] [-l | -g] [-c <value>] [--list | --value | -s <value> | ]

FLAGS
  -c, --ctx=<value>  Name of the Adobe IMS context to use. Default is the current Adobe IMS context
  -g, --global       global config
  -l, --local        local config
  -s, --set=<value>  Sets the name of the current local Adobe IMS context
  -v, --verbose      Verbose output
  --debug=<value>    Debug level output
  --list             Names of the Adobe IMS contexts as an array
  --value            Prints named or current Adobe IMS context data

DESCRIPTION
  Manage Adobe IMS contexts.

  The following options exist for this command:

  * List the names of the configured Adobe IMS contexts
  * Print the name of the current Adobe IMS context
  * Set the name of the current Adobe IMS context
  * Print the configuration of the current or a named Adobe IMS context

  Currently it is not possible to update the Adobe Adobe IMS context configuration
  using this command. Use the "aio config" commands for this.
  e.g. aio config:set ims.contexts.your_context.your_context_key "your_context_value"

  Please note, that the following IMS context label names is reserved: `cli`
  and should not be used as an IMS context name.

  Also note that the current context can only be set locally.


ALIASES
  $ aio ctx
  $ aio context
```

_参见代码 : [src/commands/auth/ctx.js (英语)](https://github.com/adobe/aio-cli-plugin-auth/blob/4.1.0/src/commands/auth/ctx.js)_

## `aio auth login`

登录特定 Adobe IMS 上下文并返回访问符 .

```
USAGE
  $ aio auth login [--debug <value>] [-v] [-l | -g] [-c <value>] [-f] [-d] [-b] [-o]

FLAGS
  -b, --bare         print access token only
  -c, --ctx=<value>  Name of the Adobe IMS context to use. Default is the current Adobe IMS context
  -d, --decode       Decode and display access token data
  -f, --force        Force logging in. This causes a forced logout on the context first and makes sure to not use any
                     cached data when calling the plugin.
  -g, --global       global config
  -l, --local        local config
  -o, --[no-]open    Open the default browser to complete the login
  -v, --verbose      Verbose output
  --debug=<value>    Debug level output

DESCRIPTION
  Log in with a certain Adobe IMS context and returns the access token.

  If the Adobe IMS context already has a valid access token set (valid meaning
  at least 10 minutes before expiry), that token is returned.

  Otherwise, if the Adobe IMS context has a valid refresh token set (valid
  meaning at least 10 minutes before expiry) that refresh token is
  exchanged for an access token before returning the access token.

  Lastly, if the Adobe IMS context properties are supported by one of the
  Adobe IMS login plugins, that login plugin is called to guide through
  the IMS login process.

  The currently supported Adobe IMS login plugins are:

  * aio-lib-ims-jwt for JWT token based login supporting
  Adobe I/O Console service integrations.
  * aio-lib-ims-oauth for browser based OAuth2 login. This
  plugin will launch the default browser to guide the user through the
  login process. The plugin itself will *never* see the user's
  password but only receive the authorization token after the
  user has authenticated with Adobe IMS.


ALIASES
  $ aio login
```

_参见代码 : [src/commands/auth/login.js (中文(简体) )](https://github.com/adobe/aio-cli-plugin-auth/blob/4.1.0/src/commands/auth/login.js)_

## `aio auth logout`

记录当前或命名为 Adobe 的 IMS 上下文 .

```
USAGE
  $ aio auth logout [--debug <value>] [-v] [-l | -g] [-c <value>] [-f]

FLAGS
  -c, --ctx=<value>  Name of the Adobe IMS context to use. Default is the current Adobe IMS context
  -f, --[no-]force   Invalidate the refresh token as well as all access tokens.
                     Otherwise only the access token is invalidated. For Adobe IMS
                     contexts not supporting refresh tokens, this flag has no
                     effect.
  -g, --global       global config
  -l, --local        local config
  -v, --verbose      Verbose output
  --debug=<value>    Debug level output

DESCRIPTION
  Log out the current or a named Adobe IMS context.

  This command can be called multiple times on the same Adobe IMS context with
  out causing any errors. The assumption is that after calling this command
  without an error, the Adobe IMS context's access and refresh tokens have been
  invalidated and removed from persistent storage. Repeatedly calling this
  command will just do nothing.


ALIASES
  $ aio logout
```

_参见代码 : [src/commands/auth/logout.js (简体中文)](https://github.com/adobe/aio-cli-plugin-auth/blob/4.1.0/src/commands/auth/logout.js)_

## `aio context`

管理 Adobe IMS 上下文 .

```
USAGE
  $ aio context [--debug <value>] [-v] [-l | -g] [-c <value>] [--list | --value | -s <value> | ]

FLAGS
  -c, --ctx=<value>  Name of the Adobe IMS context to use. Default is the current Adobe IMS context
  -g, --global       global config
  -l, --local        local config
  -s, --set=<value>  Sets the name of the current local Adobe IMS context
  -v, --verbose      Verbose output
  --debug=<value>    Debug level output
  --list             Names of the Adobe IMS contexts as an array
  --value            Prints named or current Adobe IMS context data

DESCRIPTION
  Manage Adobe IMS contexts.

  The following options exist for this command:

  * List the names of the configured Adobe IMS contexts
  * Print the name of the current Adobe IMS context
  * Set the name of the current Adobe IMS context
  * Print the configuration of the current or a named Adobe IMS context

  Currently it is not possible to update the Adobe Adobe IMS context configuration
  using this command. Use the "aio config" commands for this.
  e.g. aio config:set ims.contexts.your_context.your_context_key "your_context_value"

  Please note, that the following IMS context label names is reserved: `cli`
  and should not be used as an IMS context name.

  Also note that the current context can only be set locally.


ALIASES
  $ aio ctx
  $ aio context
```

## `aio ctx`

管理 Adobe IMS 上下文 .

```
USAGE
  $ aio ctx [--debug <value>] [-v] [-l | -g] [-c <value>] [--list | --value | -s <value> | ]

FLAGS
  -c, --ctx=<value>  Name of the Adobe IMS context to use. Default is the current Adobe IMS context
  -g, --global       global config
  -l, --local        local config
  -s, --set=<value>  Sets the name of the current local Adobe IMS context
  -v, --verbose      Verbose output
  --debug=<value>    Debug level output
  --list             Names of the Adobe IMS contexts as an array
  --value            Prints named or current Adobe IMS context data

DESCRIPTION
  Manage Adobe IMS contexts.

  The following options exist for this command:

  * List the names of the configured Adobe IMS contexts
  * Print the name of the current Adobe IMS context
  * Set the name of the current Adobe IMS context
  * Print the configuration of the current or a named Adobe IMS context

  Currently it is not possible to update the Adobe Adobe IMS context configuration
  using this command. Use the "aio config" commands for this.
  e.g. aio config:set ims.contexts.your_context.your_context_key "your_context_value"

  Please note, that the following IMS context label names is reserved: `cli`
  and should not be used as an IMS context name.

  Also note that the current context can only be set locally.


ALIASES
  $ aio ctx
  $ aio context
```

## `aio login`

登录特定 Adobe IMS 上下文并返回访问符 .

```
USAGE
  $ aio login [--debug <value>] [-v] [-l | -g] [-c <value>] [-f] [-d] [-b] [-o]

FLAGS
  -b, --bare         print access token only
  -c, --ctx=<value>  Name of the Adobe IMS context to use. Default is the current Adobe IMS context
  -d, --decode       Decode and display access token data
  -f, --force        Force logging in. This causes a forced logout on the context first and makes sure to not use any
                     cached data when calling the plugin.
  -g, --global       global config
  -l, --local        local config
  -o, --[no-]open    Open the default browser to complete the login
  -v, --verbose      Verbose output
  --debug=<value>    Debug level output

DESCRIPTION
  Log in with a certain Adobe IMS context and returns the access token.

  If the Adobe IMS context already has a valid access token set (valid meaning
  at least 10 minutes before expiry), that token is returned.

  Otherwise, if the Adobe IMS context has a valid refresh token set (valid
  meaning at least 10 minutes before expiry) that refresh token is
  exchanged for an access token before returning the access token.

  Lastly, if the Adobe IMS context properties are supported by one of the
  Adobe IMS login plugins, that login plugin is called to guide through
  the IMS login process.

  The currently supported Adobe IMS login plugins are:

  * aio-lib-ims-jwt for JWT token based login supporting
  Adobe I/O Console service integrations.
  * aio-lib-ims-oauth for browser based OAuth2 login. This
  plugin will launch the default browser to guide the user through the
  login process. The plugin itself will *never* see the user's
  password but only receive the authorization token after the
  user has authenticated with Adobe IMS.


ALIASES
  $ aio login
```

## `aio logout`

记录当前或命名为 Adobe 的 IMS 上下文 .

```
USAGE
  $ aio logout [--debug <value>] [-v] [-l | -g] [-c <value>] [-f]

FLAGS
  -c, --ctx=<value>  Name of the Adobe IMS context to use. Default is the current Adobe IMS context
  -f, --[no-]force   Invalidate the refresh token as well as all access tokens.
                     Otherwise only the access token is invalidated. For Adobe IMS
                     contexts not supporting refresh tokens, this flag has no
                     effect.
  -g, --global       global config
  -l, --local        local config
  -v, --verbose      Verbose output
  --debug=<value>    Debug level output

DESCRIPTION
  Log out the current or a named Adobe IMS context.

  This command can be called multiple times on the same Adobe IMS context with
  out causing any errors. The assumption is that after calling this command
  without an error, the Adobe IMS context's access and refresh tokens have been
  invalidated and removed from persistent storage. Repeatedly calling this
  command will just do nothing.


ALIASES
  $ aio logout
```

# 捐款

欢迎捐款! 读取 [贡献指南](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/CONTRIBUTING.md) 更多信息.

# 许可证发放

这个项目根据Apache V2许可证获得许可. 见 [自由主义](https://npmcn.com/package/%40adobe/aio-cli-plugin-auth/LICENSE) 更多信息.

## 常见问题

### @adobe/aio-cli-plugin-auth 是什么？

IMS到aio的插件支持管理 IMS 的令牌,例如登录,登录,以及检索和使用令牌等\.

### 如何安装 @adobe/aio-cli-plugin-auth？

在项目目录运行 npm install @adobe/aio-cli-plugin-auth，或使用 pnpm add / yarn add / bun add。

### @adobe/aio-cli-plugin-auth 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/adobe\_\_aio-cli-plugin-auth 是否存在。

### @adobe/aio-cli-plugin-auth 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=20。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @adobe/aio-cli-plugin-auth 可以商用吗？

@adobe/aio-cli-plugin-auth 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @adobe/aio-cli-plugin-auth 的下载量有多少？

根据 npm 官方下载统计，@adobe/aio-cli-plugin-auth 在 2026/10/05 – 2026/11/03 这 30 天内被下载 25,067 次，日均约 836 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @adobe/aio-cli-plugin-auth 还在维护吗？

最新版本 4\.1\.0 发布于 2026/05/08（5 个月前）；至今共发布 33 个版本，其中过去 12 个月发布了 1 个；首次发布于 2020/01/02。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

