Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Documentation moved to confluence
  • Loading branch information
stefmde authored Apr 13, 2017
1 parent 1948907 commit 1d69625
Showing 1 changed file with 2 additions and 105 deletions.
107 changes: 2 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,109 +5,6 @@ My try to make it easy to implement the google ReCaptcha service for a MVC Websi

---------------

##Steps to implement
##Documentation

1. Get the api key pair from google: https://www.google.com/recaptcha
2. Check the sample/demo project on [GitHub](https://github.com/stefmde/EasyGCaptchaMVC "GitHub - EasyGCaptchaMVC")
3. Download and install the Package from [nuget](https://www.nuget.org/packages/EasyGCaptchaMVC/ "nuget - EasyGCaptchaMVC")
4. Implementing the HTML-Extension `EasyGCaptchaGenerateCaptcha` in the view
5. Implementing the `ActionFilterAttribute` above the Action
6. Check the given `EasyGCaptchaResult` in the Action

---------------

##Quickstart
###Html-Extension
Calling the `Html`-Extension `EasyGCaptchaGenerateCaptcha` and pass your publickey/websitekey to it is all you have to do in the view. You kann pass a few more settings like the `Theme` mode to it.

@Html.EasyGCaptchaGenerateCaptcha(publicKey: "xyzxyzxyz...xyzxyzxyz", theme: Theme.Dark)

###ActionFilterAttribute and the result
Place the `EasyGCaptcha`-Attribute above your `Post`-Action and pass the privatekey to it.
If you have done this you have to add the `EasyGCaptchaResult easyGCaptchaResult`-Parameter to your Action. In this parameter you can check the results from Google.

[HttpPost]
[EasyGCaptcha(PrivateKey ="xyzxyzxyz...xyzxyzxyz")]
public ActionResult Index(IndexViewModel model, EasyGCaptchaResult easyGCaptchaResult)
{
if (easyGCaptchaResult.Success)
{
// Do your work here
}
model.EasyGCaptchaResult = easyGCaptchaResult;
return View(model);
}

---------------

##Some notes

- This extension automatically uses some development/testing keys from google if the app is in developement or no keys are provided
- The Extension and the Attribute provides some additional parameters to customize it

##Supported parameters
###Extension
- string `publicKey`
- Default: Dev-Key from Google
- Description: Contains the public or website key, provides by Google
- string `divID`
- Default: `EasyGCaptchaMVC_div`
- Description: Contains the id for the div which contains the module. Used for styling and things like that
- Theme `theme`
- Default: `Theme.Light`
- Description: Contains the theme setting, provided by Google
- Size `size`
- Default: `Size.Normal`
- Description: Contains the size setting, provided by Google
- Type `type`
- Default: `Type.Image`
- Description: Contains the validation type setting, provided by Google
- int `tabindex`
- Default: `-1`
- Description: Contains the tabindex for the form, provided by Google
- string `callBack`
- Default: empty
- Description: Provides the ability to call a js function if the module is fully loaded, provided by Google
- bool `forceDebugMode`
- Default: `false`
- Description: Forces the debug mode. Should be false on prduction
- bool `forceReleaseMode`
- Default: `false`
- Description: Forces release mode. For testing only
- bool `usePassthruInDebugMode`
- Default: `true`
- Description: Uses special keys, provided by Google, to show the module but always passthru it. Only for testing.
- bool `showErrorMessagesOnDebug`
- Default: `true`
- Description: Can be enabled to show error messages from the extension on the website if the site is in debug mode
- bool `disableExceptions`
- Default: `false`
- Description: Prevents the module from throwing exceptions. But can hide errors if 'ShowErrorMessageOnDebug' is false


###Attribute
- string `PrivateKey`
- Default: Dev-Key from Google
- Description: Contains the private key, provides by Google
- bool `DisableExceptions`
- Default: `false`
- Description: Prevents the module from throwing exceptions. But can hide errors if 'ShowErrorMessageOnDebug' is false
- bool `ForceDebugMode`
- Default: `false`
- Description: Forces the debug mode. Should be false on prduction.
- bool `ForceReleaseMode`
- Default: `false`
- Description: Forces release mode. For testing only.
- bool `UsePassthruInDebugMode`
- Default: `true`
- Description: Uses special keys, provided by Google, to show the module but always passthru it. Only for testing.
- bool `PassRemoteIPToGoogle`
- Default: `false`
- Description: Passes the ip of the client ip to Google. Don't know for what


###Web.config
If you want to, you can add those two keys in your Web.config. If you do that, there is no more need to pass those keys to the extension or the Attribute:

<add key="EasyGCaptchaMVC.PublicKey" value="" />
<add key="EasyGCaptchaMVC.PrivateKey" value="" />
The full documatation can be found here: https://confluence.stefmde.com/display/RCAPTCHA

0 comments on commit 1d69625

Please sign in to comment.