Code Monkey home page Code Monkey logo

aio-cli-plugin-auth's Introduction

aio-cli-plugin-auth

The Auth plugin to the Adobe I/O CLI supports managing tokens for Adobe Identity Management Services (IMS) such as login, logout, and retrieving and using tokens.

oclif Version Downloads/week Node.js CI License Codecov Coverage

Dependencies

Module Version Downloads Build Status Coverage Issues Pull Requests
@adobe/aio-lib-ims Version Downloads/week Node.js CI Codecov Coverage Github Issues Github Pull Requests
@adobe/aio-lib-ims-jwt Version Downloads/week Node.js CI Codecov Coverage Github Issues Github Pull Requests
@adobe/aio-lib-ims-oauth Version Downloads/week Node.js CI Codecov Coverage Github Issues Github Pull Requests

Motivation

This plugin provides Adobe IMS support for authentication.

This plugin supports:

  • multiple configurations for credentials
  • support for multiple authentication types (JWT, OAuth2 (three-legged via the browser))
  • support for authentication plugins (i.e. service token support)

The JavaScript Packages

The collection of Adobe IMS supporting plugins:

  • The Adobe I/O Lib Core IMS Support Library is the reusable base library providing JavaScript level API to the Adobe 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 Auth Plugin is the main auth plugin to the Adobe IO CLI.
  • Two extensions to the Adobe I/O IMS Support Library supporting creation of IMS tokens for different use cases. They all come as node packages. They are used by the Adobe I/O IMS Support Library to implement the access token creation. The plugins are:

How it works

This Adobe IO CLI Auth Plugin offers three commands:

  • login to create and return Adobe 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 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 to manage configuration contexts.

Usage

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

Commands

aio auth

Adobe IMS commands to login and logout.

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"
        }
      }
    }

See code: src/commands/auth/index.js

aio auth ctx

Manage Adobe IMS contexts.

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

See code: src/commands/auth/ctx.js

aio auth login

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

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

See code: src/commands/auth/login.js

aio auth logout

Log out the current or a named Adobe IMS context.

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

See code: src/commands/auth/logout.js

aio context

Manage Adobe IMS contexts.

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

Manage Adobe IMS contexts.

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

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

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

Log out the current or a named Adobe IMS context.

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

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

aio-cli-plugin-auth's People

Contributors

amulyakashyap09 avatar arjuncooliitr avatar dependabot[bot] avatar florind12 avatar greenkeeper[bot] avatar meryllblanchet avatar michaelgoberling avatar moritzraho avatar purplecabbage avatar rajarju avatar shazron avatar yu1986 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aio-cli-plugin-auth's Issues

`aio login` in application folder is not showing local Console config

Describe the bug

# cwd is an app folder with a specific org, project, workspace config
> aio login
<token>
You are currently in:
1. Org: <global.console.org.code>
2. Project: <global.console.project.name>
3. Workspace: <global.console.workspace.name>

This might be confusing when the local application console config does not match the global one.
Worst the same global config is shown even if I login with workspace's credentials defined in the local .env
> aio login -c <ctx from .env>

Instead of only looking up the global config (see https://github.com/adobe/aio-cli-plugin-auth/blob/master/src/ims-base-command.js#L81) we should also parse local project project.workspace project.org config keys

@adobe/aio-lib-ims will require node-12 or greater starting July 14th, 2021

Your module is dependent on @adobe/aio-lib-ims.

Adobe IMS is retiring TLS 1.0 and TLS 1.1 support on July 14th, 2021.
TLSv1.2 is the default for node-12 or higher: https://nodejs.org/api/cli.html#cli_tls_min_v1_2

Therefore any calls to Adobe IMS using @adobe/aio-lib-ims using node-10 will fail after the retirement date above.

This module should impose a minimum requirement of node-12 going forward.

Add this to your package.json:

{
   "engineStrict": true, 
   "engines" : { 
         "node" : ">=12" 
    }
}

abstraction leaking

Minor thing, but this module includes cli-ux and ora which are both never used, although they should be.
The dependent lib (adobe/aio-lib-ims-oauth/blob/master/package.json) actually uses these modules itself to present UX.
Ideally the plugin is responsible for communicating with the user, and the libraries just perform work.

aio auth login gives '127.0.0.1 refused to connect error' in wsl

Expected Behaviour

aio auth login should redirect to the login page and the login should be successful

Actual Behaviour

On running aio auth login in wsl

  1. it opens the login page but says update to the latest CLI version even though the version is 9.2.0 (latest)

image

Screenshot 2023-04-14 144425

  1. on clicking the link on the login page, it gives 127.0.0.1 refused to connect error

Screenshot 2023-04-14 144744

The browser is Chrome Version 112.0.5615.87 (Official Build) (64-bit)

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Environment Info

  System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (4) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 4.22 GB / 5.79 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 18.15.0 - /usr/bin/node
    Yarn: 1.22.19 - /mnt/c/Program Files (x86)/Yarn/bin/yarn
    npm: 9.5.0 - /usr/bin/npm
  Virtualization:
    Docker: Not Found
  npmGlobalPackages:
    @adobe/aio-cli: 9.2.0

Sample Code that illustrates the problem

Logs taken while reproducing problem

An in-range update of @adobe/aio-lib-core-ims is breaking the build 🚨

The dependency @adobe/aio-lib-core-ims was updated from 0.0.6 to 1.0.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@adobe/aio-lib-core-ims is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details

Release Notes for add action configuration context, support default cli context and plugin
  • support for ims-cli plugin in aio-lib-core-ims-oauth lib (#17) da6c3e3
  • add action configuration context (#11) 1a4e5dc
  • fix: eslint-jsdoc issues (#16) 1387a6e

0.0.6...1.0.0

Commits

The new version differs by 4 commits.

  • d313416 1.0.0
  • da6c3e3 support for ims-cli plugin in aio-lib-core-ims-oauth lib (#17)
  • 1a4e5dc add action configuration context (#11)
  • 1387a6e fix: eslint-jsdoc issues (#16)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

$console renamed to `console`

src/ims-base-command.js:19:const CONSOLE_KEY = '$console'
test/ims-base-command.test.js:107:      '$console.org.name': 'Fake Org',
test/ims-base-command.test.js:108:      '$console.project.name': 'Fake Project',
test/ims-base-command.test.js:109:      '$console.workspace.name': 'Fake Workspace'
test/ims-base-command.test.js:116:    expect(config.get).toBeCalledWith('$console.org.name')
test/ims-base-command.test.js:117:    expect(config.get).toBeCalledWith('$console.project.name')
test/ims-base-command.test.js:118:    expect(config.get).toBeCalledWith('$console.workspace.name')
test/ims-base-command.test.js:121:    delete mockConfig['$console.org.name']
test/ims-base-command.test.js:122:    delete mockConfig['$console.project.name']
test/ims-base-command.test.js:123:    delete mockConfig['$console.workspace.name']
test/ims-base-command.test.js:134:    delete mockConfig['$console.project.name']
test/ims-base-command.test.js:135:    delete mockConfig['$console.workspace.name']
test/ims-base-command.test.js:145:    delete mockConfig['$console.workspace.name']

from adobe/aio-cli-plugin-console@ea1d6f4

Update readme

Describe the bug
readme still includes info on embedded electron app

Enhance output for login and logout

Is your feature request related to a problem? Please describe.
There's no clear indication of current user's login / logout state.

Describe the solution you'd like

When a user aio (auth) login if the user is logged in, the output should be You are currently logged in, your user access token is xxx.

When a user log out aio (auth) logout the cli should output a friendly message saying You are current logged out.

An in-range update of @adobe/eslint-config-aio-lib-config is breaking the build 🚨

The devDependency @adobe/eslint-config-aio-lib-config was updated from 1.0.2 to 1.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@adobe/eslint-config-aio-lib-config is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for Add jsdoc plugin, tests and travis
  • fix: add test, .travis.yml file (closes #2, closes #3) 76753d0

1.0.2...1.1.0

Commits

The new version differs by 2 commits.

  • ff9a9f1 1.1.0
  • 76753d0 fix: add test, .travis.yml file (closes #2, closes #3)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

`aio logout` does not properly logout the cli context

Describe the bug
aio logout does not properly logout the cli context

To Reproduce
Steps to reproduce the behavior:

  1. aio login (go through all the steps to get the token)
  2. aio logout
  3. aio login

Expected behavior
The second aio login should go through the browser-based login process again, since aio logout was run previously.

Actual behavior
The second aio login shows the cached access token.

What is a context?

Documentation refers to Adobe IMS context(s) without ever giving an explanation of what that is.

Is there IMS public documentation we can redirect to? or do we need to provide this ourselves?

Login / logout do not change IMS configs object

Some CLI users randomly get 401 Unauthorized when they use the CLI on multiple commands such as aio app init or aio console org list.

 β€Ί   Error: [CoreConsoleAPISDK:ERROR_GET_ORGANIZATIONS] 401 - Unauthorized ({"error_code":"401013","message":"Oauth token is not valid"})

To overcome, they tried to aio logout, then aio login again, but it did nothing other than displaying the login info from the previous session.

As a workaround, users have to run aio config delete \$ims --local and aio config delete \$ims --global to nuke their CLI IMS configs, the log in again. Then things work as expected.

Support --no-open flag

Describe the bug
There are cases where the user is already logged in to a different org or a different context in their default browser, and running aio auth login would simply takeover this login context. It should be possible to have the CLI login context differ from the current browser login context.

By supporting a --no-open flag we could support this easily. Instead of opening the default browser, we simply output the url for the user to open and they can paste it into a new incognito browser window, or use a non-default browser to complete the login and the results would/should still be posted back to the CLI.

add troubleshooting command to test for firewall issues

aio login requires the use of a localhost server by the cli so the browser can communicate with the cli. Sometimes a user's browser has ERR_CONNECTION_REFUSED and can't connect. If it can't connect automatically, we print out a link for the user to click on (this is for Safari which has this problem).

But users are encountering this on Windows, whether in wsl or not in wsl. Have a diagnostic command or troubleshooting information so we can provide a workaround.

`aio logout` does not log the user out (access token still stored in local)

Describe the bug

$ aio login
<access-token>
$ aio logout

but after you've supposedly "logged out", the access token is not removed from config (global), so you can still see the user token and refresh token shown in aio config

To Reproduce

If you are inside a project with a local .aio, you can see the access token remove from config after you've logged out, but if you change directory to another folder without a local .aio, you can see that the access token is still there in global .aio.

$cd project-a
$aio login

$aio config

$aio logout
$aio config

$cd different-directory

$aio config

In addition, if you are inside a project with local .aio, after you have logged out if you try to type in aio logout again, it throws this error. it should really say "You are currently logged out".

$cd project-a
$aio login

$aio config
$aio logout

$aio logout
 β€Ί   Error: Cannot logout context '$cli': Token missing or expired

Expected behavior
Config should be cleared for both global AND local, and ideally aio logout should print a message saying "you are logged out"

logout does not remove refresh_token

Technically the docs say that you need to use --force to logout AND remove the refresh token, however what is the point of logout if you are not required to re-login?

Force should be the default behavior; I am not sure if there is even a need to have a logout that does not discard the refresh_token.

migrate $ims config to new ims config

New config:

{
  "ims": {
    "config": {
      "plugins": [ "p1", "p2" ],
      "current": "sample"
    },
    "contexts": {
      "sample": {},
      "another": {}
    }
  }
}

Occurrences:

README.md:98:  Configuration for the Adobe IMS commands is stored in the "$ims"
README.md:117:       $ims: {
README.md:161:        e.g. aio config:set \$ims.your_context.your_context_key "your_context_value"
src/commands/auth/ctx.js:45:     e.g. aio config:set \\$ims.your_context.your_context_key "your_context_value"
src/commands/auth/index.js:32:Configuration for the Adobe IMS commands is stored in the "$ims"
src/commands/auth/index.js:52:    $ims: {
src/commands/auth/login.js:25:      // default is the `$cli` context, if $ims.$current not set
test/commands/auth/ctx.test.js:43:    $ims: {
test/commands/auth/ctx.test.js:52:  const IMS = '$ims.'
test/commands/auth/ctx.test.js:55:      return store.$ims[key.substring(IMS.length)]
test/commands/auth/ctx.test.js:62:      store.$ims[key.substring(IMS.length)] = value
test/commands/auth/ctx.test.js:72:  await expect(spy).toHaveBeenCalledWith(store.$ims.$current)
test/commands/auth/ctx.test.js:78:    data: store.$ims[myContext],
test/commands/auth/login.test.js:115:  const IMS = '$ims'
test/commands/auth/login.test.js:122:    store.$ims.$current = data
test/commands/auth/login.test.js:126:    return store.$ims.$current
test/commands/auth/logout.test.js:83:  const IMS = '$ims'
test/commands/auth/logout.test.js:90:    store.$ims.$current = data
test/commands/auth/logout.test.js:94:    return store.$ims.$current

Use a hook to auto-migrate, see adobe/aio-cli-plugin-console@ea1d6f4
Migrate $cli to cli as well.

Depends on adobe/aio-lib-ims#46

Support specifying non-default browser for login

Describe the solution you'd like

In short...

aio auth:login --browser=Firefox

Describe alternatives you've considered

#61 defines an alternate approach for the same problem (and they're not necessarily mutually exclusive), but given that cli-ux supports specifying a different browser, more literally implementing support for an alternate browser has better IMO ergonomics.

`aio login` should sync developer console org with console config

Describe the bug
When switching organizations in the developer console, aio login may facetiously show the user as currently being in an organization / workspace / project they no longer have access to.

To Reproduce

  • login to account a in developer console
  • run aio login
  • login to account b in developer console
  • run aio logout and aio login (console should still output account a)
  • run aio app deploy (should see error, trying to deploy to account a, but still logged into account b)

Expected behavior
aio login should detect an organization switch, set organization and clear project and workspace

[Windows] Cannot logout and login into another account

Expected Behaviour

After I logout, I want to be able to login again but with another account.

Actual Behaviour

After logout, on the second login, in Chrome, I don't have a chance to switch account because it goes too fast. Therefore, I'm logged in again, but with the wrong account.

Reproduce Scenario (including but not limited to)

Pre-requisite: Working on Windows, with a Chrome browser opening the login page.

Steps to Reproduce

  • Log into an account using aio auth login
  • Logout using aio auth logout
  • Try to log into another account by changing the email address on login page. On Chrome at least, it reuses previous credentials and you should not have the time to switch account.

Platform and Version

Windows 10, Node 14

Sample Code that illustrates the problem

Logs taken while reproducing problem

What happens on subsequent logins: The "you're logged in" page appears nearly immediately.
1

README links to command source code result in 404

Describe the bug
oclif/dev-cli has a bug where it assumes a version tag is prefixed by v when it should respect the setting in .npmrc. See oclif/dev-cli#123

Workaround is setting this key in the plugin's package.json:

"oclif": {
    "repositoryPrefix": "<%- repo %>/blob/<%- version %>/<%- commandPath %>"
  }

To Reproduce
See the section for a command in README.md, the link to the source goes to 404.

Expected behavior
The link works.

Actual behavior
The link does not work.

An in-range update of @adobe/eslint-config-aio-lib-config is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency @adobe/eslint-config-aio-lib-config was updated from 1.1.0 to 1.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@adobe/eslint-config-aio-lib-config is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for add plugin:node/recommended to check for extraneous/missing requires
  • feat: add plugin:node/recommended to check for extraneous/missing requires (#7) 15102de
  • chore(package): update eslint-plugin-jsdoc to version 23.0.0 (#6) 849c15b
  • chore(package): update eslint-plugin-jsdoc to version 22.0.0 (#5) a3788dd
  • Update README.md 7c2e18e
  • Update dependencies to enable Greenkeeper 🌴 (#4) 3a9468d

1.1.0...1.2.0

Commits

The new version differs by 6 commits.

  • f6a0062 1.2.0
  • 15102de feat: add plugin:node/recommended to check for extraneous/missing requires (#7)
  • 849c15b chore(package): update eslint-plugin-jsdoc to version 23.0.0 (#6)
  • a3788dd chore(package): update eslint-plugin-jsdoc to version 22.0.0 (#5)
  • 7c2e18e Update README.md
  • 3a9468d Update dependencies to enable Greenkeeper 🌴 (#4)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Docs: Usage instructions could be clearer

Current readme looks like this:

$ npm install -g @adobe/aio-cli-plugin-auth
$ aio COMMAND
running command...
$ aio (-v|--version|version)
@adobe/aio-cli-plugin-auth/1.0.4 darwin-x64 node-v10.15.3
$ aio --help [COMMAND]
USAGE
  $ aio COMMAND
...

We should probably be clearer that this is a plugin for the aio-cli and is auto installed when the aio-cli is.

Usage should maybe go straight to :

aio login ...
aio logout ...
...

aio login does not support company or school Account not supported

Current behavior
When user run aio login, open the access page, and try to login in. User does not have the option to use Company or school accounts are not supported.

Issue reported through forum: https://experienceleaguecommunities.adobe.com/t5/project-firefly-questions/cannot-initiate-login-says-company-or-school-account-not/qaq-p/368842?profile.language=en&pageRefresh=true

To Reproduce
Steps to reproduce the behavior:

  1. aio login
  2. Log in screen shows that company and school accounts are not supported

Expected behavior
We should add support for enterprise accounts

Additional context
We suspect it's restriction from the IMS client-id used by the CLI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.