Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is it possible to run platform auth:api-token-login non-interactively #1197

Open
GaxZE opened this issue Nov 30, 2022 · 2 comments

Comments

@GaxZE
Copy link

GaxZE commented Nov 30, 2022

Seems a silly question but I am missing something.

When I run: platform auth:api-token-login --no-interaction I get:

Non-interactive use of this command is not supported.

To authenticate non-interactively, configure an API token using the PLATFORMSH_CLI_TOKEN environment variable.

Which I expect.

However if I set my environment variable first such as:

export PLATFORMSH_CLI_TOKEN="xxxx"

And then run platform auth:api-token-login --no-interaction I get:

An API token is already set via config

So when I run git fetch platform master for example I am greeted with:

Hello user (UUID: xxxxx), you successfully authenticated, but could not connect to service xxx (reason: access requires MFA)
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Worth adding, I have all my SSH keys correctly added to PlatformSH ssh-keys section.

Am I missing something here or is there a genuine bug.

@pjcdawkins
Copy link
Collaborator

When using the environment variable to set a token, you'd need platform ssh-cert:load -y to configure SSH for commands like git and ssh.

It's a good question because it's not documented

@pjcdawkins
Copy link
Collaborator

You don't need any SSH keys if you are using this certificate feature, by the way.

(And you need the certificate, not keys, for projects that enforce MFA for SSH)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants