LoginSignup
0
1

More than 5 years have passed since last update.

WordPressでID・パスワード認証をできなくする

Posted at

はじめに

GianismでTwitter,Facebook, Google, Instagramといった外部サービスアカウントによるログイン機能を組み込んだので、ID・パスワードでの認証を禁止にしました。

ID/PASSWORD認証がなくなれば少しはセキュアになるかなと思い。

functions.phpを編集

認証時のフィルターでパスワード入力があったらwp_dieしています。
priorityを1つ上げています。

add_filter( 'authenticate', 'myplugin_auth_signon', 9, 3 );
function myplugin_auth_signon( $user, $username, $password ) {
    if (!empty($password)) {
    wp_die( 'ID・パスワードでの認証はできません' );
    }
}

最後に

他に良い方法や、抜け道などありましたらご指摘いただけると幸いです。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1