Skip to content

Login via API token instead of email/password combo #2410

Closed

Description

@timbru31

Description:
It's possible to login to Ionic via the env variables IONIC_EMAIL and IONIC_PASSWORD.
For e.g. CI and other use cases a login via an API token would be the better option, but currently there is no support to authenticate via a token.

Steps to Reproduce:
n/a

Output:
n/a

My ionic info:

❯ ionic info                                                                                                                                                                                                                                                         [10:00:49]
[WARN] You are not in an Ionic project directory. Project context may be missing.

global packages:

    @ionic/cli-utils : 1.3.0
    Ionic CLI        : 3.3.0

System:

    Node       : v8.1.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b
    ios-deploy : not installed
    ios-sim    : not installed

Other Information:
Related issue and suggestion of @dwieeb here: #2293 (comment)

Activity

  1. added this to the CLI Future milestone on Jun 9, 2017
  2. imhoffd commented on Aug 2, 2017

    @imhoffd
    Contributor

    @timbru31 For this to work for the "Ionic Cloud" services (https://apps.ionic.io), you'd need to use the "appUser" token type for a single app listed in ~/.ionic/config.json. One token could only work on one app, which isn't really a problem for CI, but it'd be an annoyance for local development.

    Still worth it?

  3. modified the milestones: CLI Future, 3.13.0 on Sep 22, 2017
  4. imhoffd commented on Sep 22, 2017

    @imhoffd
    Contributor

    This works better with Ionic Pro! There is just one token.

  5. modified the milestones: 3.13.0, CLI Future on Oct 10, 2017
  6. imhoffd commented on Oct 10, 2017

    @imhoffd
    Contributor

    Waiting on some server changes before this gets in.

  7. modified the milestones: CLI Future, CLI 4.0.0 on Jan 10, 2018
  8. timbru31 commented on Jan 17, 2018

    @timbru31
    Author

    Awesome that this is added, thanks a lot @dwieeb - but where can I find/generate API tokens for Ionic Pro?

  9. imhoffd commented on Jan 18, 2018

    @imhoffd
    Contributor

    @timbru31 Apologies, I'll have more documentation for this for the actual CLI v4 release.

    You can find your token (once logged in with ionic login) with this command: ionic config get -g tokens.user (exclude the quotes, of course).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions