Problem/Motivation

I currently have the use case, where I manually fire a JSON POST request from an external app to a rest endpoint exposed by the "Webform Rest" module. This webform has altcha as their webform validation.

The problem is, inside "altcha_captcha_validation", we use the symfony request object. This request object is only automatically populated for standard html form submissions. Not for json form submissions.

Meaning, that "$request->request->get('altcha')" won't get me the altcha hash, since it is inside the json body of my request.

Steps to reproduce

Fire a POST with Content-Type "application/json" and put the the payload value in the body.

Proposed resolution

If the hash is not in the request "hash" parameter, check, whether it is in the request body.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#3 3589891-allow-altcha-validation-3.patch925 bytesgrevil

Issue fork altcha-3589891

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

grevil created an issue. See original summary.

grevil’s picture

Status: Active » Needs review
StatusFileSize
new925 bytes

Done. Please review!

Attached a patch for the time being.

grevil’s picture

Issue summary: View changes
anybody’s picture

Related issue, while I don't think this can be resolved in webform_rest: #3259841: Add CAPTCHA support