Basically I am trying to figure out a way to do the following;

My customer is trying to have a password protected website. The only catch is he wants visitors to get a specific random password as a reply when said customer sends a SMS to a particular number.

Basically the customer runs a somewhat exclusive clothing line and he wants people to buy or visit the website ONLY if they previously texted the particular cellphone line to get the password.

The process to get to the website would be somewhat like;

The customer knows he has to text a specific number to get a unique password. He texts anything he wants to the number.

The phone line then immediately sends a reply along the lines of: Thank you for your interest in X CLOTHINGS, your unique access code to access our website is UIHR42

The customer then visits a password protected wordpress site and enters this unique one-time password to unlock it.

Is this in any way feasible?

  • Sure. If the complete WordPress instance can be protected, I would probably to the authentication before WP even gets loaded, e.g. via HTTP Basic Auth. The service that receives the SMS and sends a password could populate the .htpasswd file. Or something completely else, sadly your question is way too broad and probably not specific to WordPress itself – kero Apr 3 '19 at 17:32
  • Or you could adapt something like the password protected plugin: you'd just need to modify the password check code to look up the one-time-passwords from somewhere and either invalidate them on use or let them time out etc. instead. (Or do the authentication on another system and redirect to the WordPress site using a signed token, and then the WordPress site would generate the access cookie after verifying the token, etc.) – Rup Apr 3 '19 at 23:00
  • I assume you don't need these users to sign up to the site, just gain access with a one time password? Are you trying to track them back to the phone number they texted with, i.e. do you want to remember which password they logged in with? – Rup Apr 3 '19 at 23:00

Your Answer

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

Browse other questions tagged or ask your own question.