Skip to content

Commit 23c9bda

Browse files
authored
Update README.md
1 parent 91a6480 commit 23c9bda

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Recaptcha-mvc
22
The .NET library for integrating Google Recaptcha V3 into ASP.NET MVC 3 or higher.
33

4+
5+
46
### Usage
57

68
- Suppose you have a ASP.NET MVC project.
@@ -9,6 +11,36 @@ The .NET library for integrating Google Recaptcha V3 into ASP.NET MVC 3 or highe
911
- Download the sample project from this repository.
1012
- Follow it to integrate Google Recaptcha V3 into your web application.
1113

14+
### API
15+
16+
#### HtmlHelper static class
17+
- **HtmlHelper.SetupHiddenRecaptcha**: insert the recaptcha hidden field.
18+
- **HtmlHelper.SetupClientScript**: insert the Google Recaptcha v3 script and lib's script to display captcha.
19+
20+
#### CommonHelper static class
21+
- **CommonHelper.ValidateRecaptchaV3**: validate the captcha against secret key and token.
22+
- **CommonHelper.AddErrorAndRedirectToGetAction**: add error to TempData and redirects to the current action.
23+
- **CommonHelper.RedirectToUrl**: redirects to a specific action.
24+
- **CommonHelper.AddErrorToModelState**(by default): adds an error message to ModelState in the current action.
25+
26+
#### Recaptcha3ActionFilterAttribute filter
27+
28+
This filter is used for verifying the captcha for a number of required URLs. This accepts three parameters:
29+
30+
- SecretKey: the secret key of Google Recaptcha V3 service.
31+
- FilterItems: a number of conditions which are valid for the catpcha verification.
32+
- OnFailure: in case the catpcha verification is failed, this action will be executed. By default, **CommonHelper.AddErrorToModelState**
33+
- RecaptchaFieldName: the HTML field name of the captcha. By default, **recaptcha_response**.
34+
35+
### Feedback
36+
Any feedback are appreciated a lot.
37+
38+
### Change Logs
39+
40+
#### v0.1.0
41+
42+
- Supports ASP.NET MVC 3 and higher.
43+
1244
### Copyright and License
1345
©Copyright 2020 by 1001binary
1446
MIT License

0 commit comments

Comments
 (0)