AspNetCore.ReCaptcha icon indicating copy to clipboard operation
AspNetCore.ReCaptcha copied to clipboard

Support or Example for Blazor

Open GPT-John opened this issue 2 years ago • 6 comments

Would you have an idea how I'd go about using this in Blazor?

Its a nice neat library would be great to get it working.

GPT-John avatar Mar 14 '22 03:03 GPT-John

Hi, I haven't tried to use the library with blazor so I'm not sure if we would need to add something specific for that.

I think the biggest problem would be to get the recaptcha input field in the razor markup, as you can't use the tag helpers. Validating the CAPTCHA should be the same as for MVC, just include the recaptcha value in the call to your API (however it might currently only work with a form post and not json). In that case we also provide an IReCaptchaService you can inject in your controller and validate it manually.

I will try to create a sample project for blazor to see how this could work.

sleeuwen avatar Mar 16 '22 19:03 sleeuwen

Thank you for the response, an Example would be very helpful.

Regards.

On Thu, Mar 17, 2022 at 3:56 AM Stephan van Leeuwen < @.***> wrote:

Hi, I haven't tried to use the library with blazor so I'm not sure if we would need to add something specific for that.

I think the biggest problem would be to get the recaptcha input field in the razor markup, as you can't use the tag helpers. Validating the CAPTCHA should be the same as for MVC, just include the recaptcha value in the call to your API (however it might currently only work with a form post and not json). In that case we also provide an IReCaptchaService you can inject in your controller and validate it manually.

I will try to create a sample project for blazor to see how this could work.

— Reply to this email directly, view it on GitHub https://github.com/michaelvs97/AspNetCore.ReCaptcha/issues/36#issuecomment-1069557261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVC6OG2U4WHCFSFYF252HB3VAI4FHANCNFSM5QUK2O2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

-- John Anderson @.***

Genesis Petroleum Technologies Pty Ltd www.genesispetroleum.com.au http://www.genesispetroleum.com.au 9/8 Sarich Way, Technology Park Bentley, WA, 6102, Australia

GPT-John avatar Mar 16 '22 23:03 GPT-John

Hello @sleeuwen. Pleaese is there any progress with the Blazor example ?

Kebechet avatar Apr 02 '22 12:04 Kebechet

Hi, I haven't been able to create a version for Blazor. I don't personally use Blazor so having to figure out how it works in addition to how to update the lib for use within Blazor is quite some work which I can't get around to at the moment. If anyone wants to try this for themselves we would gladly help with any questions and review a PR, but for now we won't have time to do that ourselves.

sleeuwen avatar Jul 30 '22 13:07 sleeuwen

Would love to see this working as well. It seems like none of the popular libraries support razor.

bander87 avatar May 12 '23 03:05 bander87

We don't currently have time to add this as we lack the experience for Blazor apps. You're welcome to create a PR with an implementation for this.

sleeuwen avatar Jul 20 '24 14:07 sleeuwen