AspNetCore.ReCaptcha
AspNetCore.ReCaptcha copied to clipboard
Support or Example for Blazor
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.
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.
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
Hello @sleeuwen. Pleaese is there any progress with the Blazor example ?
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.
Would love to see this working as well. It seems like none of the popular libraries support razor.
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.