# aio-cli-plugin-ims **Repository Path**: mirrors_adobe/aio-cli-plugin-ims ## Basic Information - **Project Name**: aio-cli-plugin-ims - **Description**: Adobe I/O CLI IMS Plugin - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-03-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README aio-cli-plugin-ims ================== # DEPRECATED IN FAVOR OF THE [AUTH PLUGIN](https://github.com/adobe/aio-cli-plugin-auth) The IMS plugin to aio supports managing tokens for IMS such as login, logout, and retrieving and using tokens. [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) [![Version](https://img.shields.io/npm/v/@adobe/aio-cli-plugin-ims.svg)](https://npmjs.org/package/@adobe/aio-cli-plugin-ims) [![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-cli-plugin-ims.svg)](https://npmjs.org/package/@adobe/aio-cli-plugin-ims) [![Build Status](https://travis-ci.com/adobe/aio-cli-plugin-ims.svg?branch=master)](https://travis-ci.com/adobe/aio-cli-plugin-ims) [![License](https://img.shields.io/npm/l/@adobe/aio-cli-plugin-ims.svg)](https://github.com/adobe/aio-cli-plugin-ims/blob/master/package.json) [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-cli-plugin-ims/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-cli-plugin-ims/) * [DEPRECATED IN FAVOR OF THE [AUTH PLUGIN](https://github.com/adobe/aio-cli-plugin-auth)](#deprecated-in-favor-of-the-auth-pluginhttpsgithubcomadobeaio-cli-plugin-auth) * [Motivation](#motivation) * [Goals](#goals) * [The JavaScript Packages](#the-javascript-packages) * [How it works](#how-it-works) * [PS](#ps) * [Usage](#usage) * [Commands](#commands) * [Contributing](#contributing) * [Licensing](#licensing) # Motivation IMS integration for authentication and subsequent use of the CLI for service access is critical to the success of the CLI. To that avail, this functionality needs to be as complete as to support anything the browser UI supports as well. In the end, this means support for logging in not only with JWT tokens for technical accounts but also leveraging the SUSI flow for three-legged user based authentication and even, at least for Adobe internal teams, with service tokens. The current [JWT Auth Plugin for the Adobe I/O CLI](https://github.com/adobe/aio-cli-plugin-jwt-auth) does a decent job supporting JWT based flows with some limitations, though: * Only a single configuration is supported, thus not allowing to switch for different configurations and thus different setups depending on the actual CLI task at hand. Even with the new local configuration support we are still limited to one configuration per local environment. * The configuration contains a lot of boiler plate data, which is the same for many configurations. This also makes the configuration hard to manage. * Only JWT tokens are supported. So we are missing real user tokens created using the SUSI UI based flow as well as service tokens, which are sometimes used by Adobe internal teams. * The actual JWT signing and token exchange are not easily re-usable outside of the CLI plugin. # Goals So the goal of this project along with the companion repositories is to provide more complete support: * Have a separate module implementing a JavaScript interface to the IMS API, so that this IMS API can be leveraged from multiple places, inside of the Adobe I/O CLI IMS Plugins or outside. * Store as little information in the configuration data as possible. This boils down to the absolutely needed fields, such as `client_id`, `client_secret`, `private_key` etc. The boilerplate, such as the bulk of the JWT token should be provided dynamically. * The plugins should support all three of the login mechanism: SUSI/UI based for user token, JWT based (technical/utility) user tokens, as well as Adobe-internal service tokens. # The JavaScript Packages Without much further ado, here is the collection of IMS supporting plugins: * The [Adobe I/O Lib Core IMS Support Library](https://github.com/adobe/aio-lib-ims) is the reusable base library providing JavaScript level API to the IMS APIs as well as getting access to tokens. All the functionality of this library is available by simply requiring this library. * This [Adobe I/O CLI IMS Plugin](https://github.com/adobe/aio-cli-plugin-ims) is the main CLI plugin to the Adobe IO CLI. See #plugin for more details below. * Three extension to the _Adobe IO IMS Support Library_ supporting creation of IMS tokens for different use cases. They all come as node packages. They are used by the _Adobe IO IMS Support Library_ to implement the access token creation. The plugins are: * The [Adobe I/O Lib Core IMS Library JWT Support](https://github.com/adobe/aio-lib-ims-jwt) supporting the generation and exchange for an access token of JWT Tokens. * The [Adobe I/O Lib Core IMS Library OAuth2 Support](https://github.com/adobe/aio-lib-ims-oauth) supporting the creation of tokens using the normal browser-based SUSI flow. To that avail the SUSI flow part is implemented as an embedded [Electron app](https://electronjs.org) driving the browser based interaction and capturing the callback from IMS. # How it works This _Adobe IO CLI IMS Plugin_ offers four commands: * [`login`](#aio-imslogin) to create and return IMS access tokens. Since tokens are cached in the Adobe IO CLI configuration, an actual token is only created if the currently cached token has already expired (or is about to expire within 10 minutes). * [`logout`](#aio-imslogout) invalidate cached tokens and remove them from the cache. Besides the access token, this can also be used to invalidate any refresh token that may be cached. * [`ctx`](#aio-imsctx) to manage configuration contexts. * [`plugins`](#aio-imsplugins-plugin) to manage configuration contexts. * [`profile`](#aio-imsprofile), [`organizations`](#aio-imsorganizations), and [`session`](#aio-imssession) to retrieve respective IMS information * Low level [`get`](#aio-imsget-api) and [`post`](#aio-imspost-api) to directly call IMS API using raw HTTP `GET` and `POST` requests. # PS Oh, and yes, docs and tests are a bit lacking this time ... I want to just get this out ASAP for anyone to have a look. # Usage ```sh-session $ aio plugins:install -g @adobe/aio-cli-plugin-ims $ # OR $ aio discover -i $ aio ims --help ``` # Commands * [`aio ims`](#aio-ims) * [`aio ims:ctx`](#aio-imsctx) * [`aio ims:get API`](#aio-imsget-api) * [`aio ims:login`](#aio-imslogin) * [`aio ims:logout`](#aio-imslogout) * [`aio ims:organizations`](#aio-imsorganizations) * [`aio ims:post API`](#aio-imspost-api) * [`aio ims:profile`](#aio-imsprofile) * [`aio ims:session`](#aio-imssession) ## `aio ims` IMS commands to login and logout. ``` USAGE $ aio ims DESCRIPTION The main commands are ims:login to get or create an access token and ims:logout to invalidate an access token and thus log out from IMS. Logging in and out is based on configuration of which there may be multiple. Each set of configuration properties, called an IMS context, can be individually addressed by a label. Configuration for the 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 ims ctx -s