ionos-cloud / ionosctl

The IONOS Cloud CLI (ionosctl) gives the ability to manage IONOS Cloud infrastructure directly from Command Line.
Apache License 2.0
30 stars 6 forks source link

Support login with 2FA #445

Open farodin91 opened 5 months ago

farodin91 commented 5 months ago

Current SDK Version

6.7.6

Use-cases

Basic Auth isn't support anymore. It would be great to login with the 2FA.

Attempted Solutions

Proposal

Support login with 2FA.

References

avirtopeanu-ionos commented 5 months ago

Hi, if you have 2FA enabled you need to use the DCD to manage your tokens: https://docs.ionos.com/cloud/getting-started/basic-tutorials/manage-authentication-tokens#generate-authentication-token

You can then use this token in the CLI by exporting IONOS_TOKEN or generate a config file containing that token: ionosctl login --token TOKEN.

From https://api.ionos.com/docs/cloud/v6/:

For the Token management APIs, if you have:

  • 2-Factor Authentication enabled, then you are no longer allowed to create or delete tokens using this API. You can use the Token Manager in the Data Center Designer (DCD) to create or delete tokens.

Since ionosctl uses this API for the 'token' command, we can't add support for token creation with 2FA enabled.

farodin91 commented 5 months ago

It would be great to support a flow via cli/api as it complicated to automate the process with manual UI interaction.