cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Magento2 Recaptcha in GraphQl APIs

How to use Magento2 Recaptcha in GraphQl APIs

I want to Use Captcha / Recaptcha in my Graphql APIs I got this link for protected mutations

It only shows to insert it in headers but it won't do anything in Graphql apis and for rest apis it gives error of recatcha validation failed

Please guide how will i provide the value of captcha and from where i will get the these values to authorized the user ?

2 REPLIES 2

Re: How to use Magento2 Recaptcha in GraphQl APIs

Navigating Magento2 Recaptcha integration with GraphQL APIs can be challenging, but I'm here to help! To successfully implement Captcha/Recaptcha for protected mutations, ensure you're including the necessary values in the headers as specified. To address the issue of Recaptcha validation failure in REST APIs, consider obtaining the Captcha response values from your frontend. Integrate a frontend Captcha solution that communicates with Magento2, and pass the obtained values through your GraphQL requests. This way, you authenticate users seamlessly by providing the Captcha values directly from your frontend. If you encounter further issues, Magento2 forums and documentation might provide additional insights. Happy coding!

Re: How to use Magento2 Recaptcha in GraphQl APIs

Hi! Include the ReCaptcha token in GraphQL API headers for Magento2. Double-check token generation and transmission. Adjust ReCaptcha settings in the Magento2 backend if needed. Consult Magento documentation or community forums for further assistance.