0

I am looking to create a function filter or plugin to remove the authentication of the password for wordpress. The registration process for each user is done manually from the backend of wordpress (no frontend registration). So there would still be a level of authentication by just testing if the email is a valid know email in the user database, just no password authentication.

I know there is a security risk involved in doing this but the content the user would access is not very sensitive at all. I wouldnt like this feature to affect the wp-login.php area ideally. That way admins still have to use a password.

I know there are email token solutions for this but I dont want that.

  • Question... Although this would be an insecure method, could I create users (subscriber role specifically) that all have the same password i.e. "password123". Write some code that automatically fills the password field with that given value "password123". Then hide the password field with css so you only see the email field. This, of course, would have to apply only to the front end of the website login and not the wp-login.php page. Therefore any subscriber can login with jsut email but the admin must still enter their password. I know its not the cleanest and doesn't address user escalation. – Luke Baumann Sep 1 '17 at 15:32
1

You might be able to make your own login form that bypasses the wp_login() function. This page https://codex.wordpress.org/Customizing_the_Login_Form , in the "Make a Custom Login" section, might get you started.

There are no hooks that I see in the https://core.trac.wordpress.org/browser/tags/4.8/src/wp-login.php code that you can use to bypass the password field. So creating your own login page, with associated form processing code, might be how this could be done.

There are lots of plugins that have to do with customizing the login form, perhaps one of those has the features you need.

You might be able to use the action login_form to change the 'action' part of the login form to code of your choosing (that, perhaps, just ignores the password field checking and just looks up the user).

Your question indicates that you are aware of security risks associated with not verifying logins.

0

This sounds like a complex insecure solution to a simple problem. If the "users" do not need access to the admin, just make a form with which they can fill their "email" and if it checks against a white listed email list, set a cookie. On the pages with the info, check that the cookie is set.

Why insecure? first it is not smart to play with the authentication system unless you know perfectly well what you are doing and what are the implication, and second, for the last few years, privilege escalation was one of the main security issue wordpress, plugins and themes have. You should not give any privilege unless you must.

  • Thanks Mark for the reply and advice. I figured there was an outside the box solution to my issue. My only issue with this method is that I would like to be able to monitor login/logout events with a wordpress plugin. That way I can monitor login events on a single user level. So ideally I would like to use the native "user" system to store and authenticate users. Do you have any other ideas? – Luke Baumann Sep 1 '17 at 15:15
  • Question... Although this would be an insecure method, could I create users (subscriber role specifically) that all have the same password i.e. "password123". Write some code that automatically fills the password field with that given value "password123". Then hide the password field with css so you only see the email field. This, of course, would have to apply only to the front end of the website login and not the wp-login.php page. Therefore any subscriber can login with jsut email but the admin must still enter their password. I know its not the cleanest and doesn't address user escalation. – Luke Baumann Sep 1 '17 at 15:27
  • you can do what you describe, but you will be open to brute force attacks which will find it easy to get access if you give a common easy password, or make the user annoyed with hard password they find hard to remember since they didn't select them. Frankly I say "insecure", but it is hard to estimate the actual amount of risk. – Mark Kaplun Sep 2 '17 at 3:26
  • As for monitoring... if this is a requirement to be done this way, then you do not have many choices, but you could just store the login information in some non autoloading option as well (or make a separate table for it) and store the login at the same time you generate the cookie – Mark Kaplun Sep 2 '17 at 3:26
0

There is another solution to this. Use the "WordPress" natively built-in password-protected post function.

By using ACF you can set multiple passwords for one post. E.g. you can set e-mail addresses as a password. No need to tamper with the WP_Login() function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.