Help us understand the problem. What is going on with this article?

【Wordpress】Application Passwordsで何度やっても401(Unauthorized)が返ってくる

【結論】.htaccessの設定ミス

ポストマンから何度やっても401で返ってくる。。。
base64はやってるし何がいけないんだ。。。

ターミナルでbase64にする

echo -n "test:jifw awad 8BDX l0aa fP02 pkIW" | base64
dGVzdDpqaWZ3IGF3YWQgOEJEWCBsMGFhIGZQMDIgcGtJVw==

よくよくユーザー一覧→パスワードの設定を見ると警告がでてました。
スクリーンショット 2019-09-02 8.37.04.png

.htaccessに下記、コードを追記してHTTP認証を受け付ける。

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}] // 【追加】
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

管理画面を再読み込みして警告がなくなってることを確認
スクリーンショット 2019-09-02 8.33.36.png

参考

https://github.com/georgestephanis/application-passwords/wiki/Basic-Authorization-Header----Missing

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした