PaulMiami / reCAPTCHA

reCAPTCHA 2.0 for ASPNET Core
MIT License
134 stars 37 forks source link

ArgumentException: The 'SiteKey' option must be provided. #3

Closed lifescream closed 7 years ago

lifescream commented 8 years ago

Hi,

I keep getting "ArgumentException: The 'SiteKey' option must be provided." even though the key provided in the ConfigureServices. I use MVC Core 1.1. Any ideas what the problem might be?

Regards, Dirk

PaulMiami commented 8 years ago

Hi,

If you use the Configuration, like in the sample code or the documentation, try do place a debug point in the ConfigureServices Method and inspect the value of "Configuration["Recaptcha:SiteKey"]".

Thanks, Paul

koopermark commented 7 years ago

Hi,

I have the same problem, when testing. I have followed this link http://stackoverflow.com/a/38487085 and also on your wiki page. I have localhost added to google too. I have added the site key and secret key as follows.

SiteKey = Configuration["key info placed here"], SecretKey = Configuration["key info placed here"], ValidationMessage = "Are you a robot?"

I get the following error An unhandled exception occurred while processing the request. ArgumentException: The 'SiteKey' option must be provided. PaulMiami.AspNetCore.Mvc.Recaptcha.Guards.CheckMandatoryOption(string s, string name)

I am using "Microsoft.NETCore.App": { "version": "1.1.0",

King Regards Mark

PaulMiami commented 7 years ago

Hi,

It seems to me like an issue with using the Configuration object and that you are getting null out of: Configuration["key info placed here"] Try to hard code the value just for testing, to rule out any other issues and then look at the configuration to understand why you are not getting the expected values.

Thanks, Paul

rready commented 7 years ago

Did this ever get resolved? I have the same problem

PaulMiami commented 7 years ago

Hi,

This is all pointing to a issue with your configuration, try not to use the "Configuration" object and just hard code the "SiteKey" and "SecretKey" values. Once that works, circle back to the Configuration object and debug the values coming out of it.

Thanks, Paul

rready commented 7 years ago

Thanks

On Jan 24, 2017 8:03 AM, "Paul Biccherai" notifications@github.com wrote:

Hi,

This is all pointing to a issue with your configuration, try not to use the "Configuration" object and just hard code the "SiteKey" and "SecretKey" values. Once that works, circle back to the Configuration object and debug the values coming out of it.

Thanks, Paul

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PaulMiami/reCAPTCHA/issues/3#issuecomment-274797211, or mute the thread https://github.com/notifications/unsubscribe-auth/AWXy5WRRGn2Ge8Ei1ItZ7vdQfjMkY6SWks5rVfaOgaJpZM4LB8Qc .