Recaptcha error - ruby-on-rails

I have a problem with Recaptcha gem. I'm using Ubuntu on a virtual machine (VirtualBox). It uses bridged network interface card, so I have internet access there and I can see this Ubuntu from my host computer.
When I run rails s and than go to
127.0.0.1:3000 on virtual machine everything is fine.
192.168.0.103:3000 on host machine there is an error with recaptcha box.
Input error: Invalid referer is where the box is supposed to be.
Why is it like that and how to fix this?

But, when we tried to host the same application to any server with the same pair of keys, it will not generate an error but, it will display like "input error - invalid referer" instead of captcha in your form.
Because, when we are getting the pair of keys from Google API, we will specify the domain name there. In that, to use those keys in your local system, we will enter domain as "localhost". But, these pair of keys will not work when we deploy that application in any server.
So, for the application to work in the remote host, we should get the pair of keys from Google API with the domain name, where we are going to deploy your application. And use them in your application.
Note:
We can have a new pair of keys for recaptcha using following link:
http://www.google.com/recaptcha/whyrecaptcha

Related

How to get SSL working on Rails app with Heroku?

I am trying to get SSL working on my Rails app that I am deploying with Heroku.
I have used the automated certificate management from Heroku and followed the directions, but when I visit my site I still see a “Not Secure” label in the URL bar. I am trying to figure out how to address this.
My site is at http://give.toacause.com/. When I use inspect in the chrome browser and go to Security, I read that the certificate is missing. However, when I click “view certificate”, I see a notice that “This certificate is valid.”
What step am I missing here?
It appears as though the CNAME record for give.toacause.com is mysterious-bastion-66058.herokuapp.com
You need to use *.herokudns.com.
heroku domains will output something like
Domain Name DNS Record Type DNS Target
give.toacause.com CNAME give.toacause.com.herokudns.com
You need to set the CNAME to the value of the DNS target field. After you do, make sure you flush your DNS cache so you can resolve and check it again, or use one of the many HTTPS checkers on the internet.

unable to connect through SSH key to bluemix container

I am currently trying to use the bluemix container service (in beta)
When I want to create a new container, I follow the steps, and just choose the name and the ports to open. I paste a SSH, and at the end I get the error :
"Unable to create container. Error message returned is: Bad Request".
Whereas if I do not paste my key, there is no problem.
I have tried with another key, created with puttygen, and I still get the same error.
I don't know what is wrong, as I basically chose the default options.
I have tried with the browsers firefox & opera on windows.
How can I solve this?
Use a public key of the form "ssh-rsa", space, 200+ characters ending in ==, space, username#hostname. I generated mine using ssh-keygen -t rsa. I pasted the entire contents of the generated .pub file.

Custom headers are not working in Amazon EC2 server

We are building an API and using Rest Console extension of Chrome for testing purpose. We have deployed our Application on Heroku server for debugging and on EC2 server as well. It is giving correct results on Heroku server with Custom headers. But for EC2 server, the custom headers are not passing. Because of which the correct results are not displayed on the EC2 server. While checking the EC2 server log file we found that the custom headers does not exist in HTTP Header.
From Local system we are requesting using Restclient:
RestClient.get('http://ec2-54-225-122-111.compute-1.amazonaws.com/method_name',{"Authorization"=> authorization_element,"custom_header1"=>val1,"custom_header2"=>val2})
Is there any settings we need to do in order to get custom HTTP Header in Amazon AWS server?
EDIT: I'm using EngineYard for deployment process.
I got the solution by passing the names without underscore.
I was passing the custom header with name having underscore like custom_header1="some value".
And from here, I come to know that underscore is not allowed although hyphen is allowed which is further converted into underscore.

How can I find out what my 'On-Premises Authority' url is?

I'm setting up a new .NET MVC project and want to use my local ADFS for managing users. I know the IP address of the machine my ADFS is running on and have tried using that for the 'On-Premises Authority' URL, but I got an message stating that it was incorrect.
Is there a command I can run to find the address/url that I should be using for this field?
For reference, this is the menu box I'm talking about:
You insert the metadata address of your ADFS e.g.
https://some-server/federationmetadata/2007-06/federationmetadata.xml
This must be provided by your IT-Team.
Usually it is:
https://YOUR-ADFS-SERVER/FederationMetadata/2007-06/FederationMetadata.xml

rails recaptcha on localhost? windows causing issues?

I just checked out this answer: Rails Recaptcha plugin always returns false
but it didn't seem to help. I'm trying to run recaptcha on rails on my local machine. The site says the API keys should work for prod and local. I've checked the keys many times and have even tried "workarounds" where you explicitly feed in the pub/priv key (since I'm running on windows). I just wanted to know if there's a known issue with windows, or if there's an issue with running on localhost, or if this plugin is out of date? Thanks.
I'm always getting the error that my captcha is wrong. I even tried the sound type, still wrong. Apologies if this is just a silly question, I just wanted to rule out everything that may be a known issue.
When getting an API key for ReCaptcha a domain must be specified. localhost won't work but your hostname should. As the recaptcha site says:
By default, your reCAPTCHA key is restricted to the specified domain, and any subdomains for additional security
Find out your hostname at the following link and use it as the domain for you API keys:
http://whatismyipaddress.com/staticpages/index.php/what-is-my-hostname
My provider happens to be Comcast, so I created a global API key for comcast.net
https://admin.recaptcha.net/recaptcha/createsite/

Resources