On my site i have one form for client to submit their WordPress site details. On that form containing these fields WordPress admin url, username, and password. I want to check their login details are valid before submitting the form. How i do that?
If there any way to do by using WordPress REST API?
If anyone know please help me Thanks !
3 Answers
Getting user names and passwords is a horrible idea I hope no user will actually agree to, but beyond that your idea to do it from JS is going to fail due to CORS, which means you will have to do it in AJAX to your server, and let your server try to login, which in turn will most likely flag it as a brute force attacker in no time, and all the major security players will just automatically block the requests.
You need to redesign you software to not need user name and password, probably use something like oauth2 instead. If oauth2 is not applicable for your situation…. well, tough luck.