php - securing slim 3, RESTful API -




i know how implement token based authentication. concern user actions register,login or verify, against attacking bots. can imagine bot making requests through fake phone numbers , sms or mail server respond of them! or thousands of registered users in users table in database fake , not verified. know firewall strategies block these type of attacks , traffics in network layer. possible secure "unauthenticated" http actions captcha code or way?

if yes, how can send captcha image api server client? in raw? if send captcha possible how can find captcha client? session can helpful?

thanks attention.

you implement form of csrf (cross site request forgery) trapping avoid this. use combination of csrf , honeypot fields. here basic rundown:

  1. the server populates field via hidden-type input tag containing value set on fly , stored on server session variable.
  2. the form contains textfield (type="text" or textarea) hidden using css.
  3. when form posted, hidden value (csrf) token must match saved session version, and
  4. the honeypot field must empty.

if tests fails, respond 401 or 404

reg bots fill honeypot fields, , smart enough circumvent csrf - log attempts fail these tests , capture quite few bot attempts.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -