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

Add support for application passwords #141

Open
1 task done
spacedmonkey opened this issue Jan 16, 2024 · 1 comment
Open
1 task done

Add support for application passwords #141

spacedmonkey opened this issue Jan 16, 2024 · 1 comment

Comments

@spacedmonkey
Copy link

Feature Request

Describe your use case and the problem you are facing

Application passwords as a REST API authentication as added back in WordPress 5.6. This allow for authenticated requests by passing username and application password. It would be great if RESTful command fully support this.

Currently it is possible to use application password by passing username and password in the command like this.

wp rest --http=http://admin:"X9yS 9YYn pbaU 5H8A kJNO DEfe"@www.example.com post create --content=wibble --title=wibble

However, this is not espcially secure. As the password is written in plan text in the command.

Describe the solution you'd like

There are a number of ways this could be implemented,

  • New paramters.
wp rest --http=https://www.example.com --application_user=admin --application_password=password
  • Use envoriment variables
    Username and password could be read in via envoriment variables.

  • Via wp-cli.yml
    Username and password could be read in via wp-cli.yml

It would also be nice, if this command supported, application registion as well. But this is a nice to have.

@danielbachhuber
Copy link
Member

I'm open to a PR on this, and I don't have a strong opinion on the implementation at this point. I'd look at authentication for other CLI tools for inspiration.

Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices.

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

No branches or pull requests

2 participants