Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Recaptcha on GWT
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
benjo  
View profile  
(1 user)  More options Apr 27 2008, 4:03 pm
From: benjo <benejos...@gmail.com>
Date: Sun, 27 Apr 2008 13:03:24 -0700 (PDT)
Local: Sun, Apr 27 2008 4:03 pm
Subject: Recaptcha on GWT
Hi everybody!

First time poster, long time lurker.  I have been struggling with
getting recaptcha to work with GWT, and finally succeeded.  I thought
I would share how I did this.  The method I solved this problem
involves some JNSI, but also modifying some of that static content in
your .html file.  It is inelegant, but I could not get a pure JNSI
implementation to work.

Step 1:

Change your .html file so that it has the proper scripts from
recatpcha.net.  Add these lines above your include for the nocache.js
(your main GWT javascript source file):

<script type="text/javascript" src="http://api.recaptcha.net/js/
recaptcha_ajax.js"></script>
<script type="text/javascript" src="recaptchaimpl.js"></script>

You do not have recaptchaimpl.js, yet...

Step 2:

Make a new javascript file, called recaptchaimpl.js, and place it in
your public directory (com.whatever.public) along with your .html file
and .css file.  You will need your recaptcha public key, which you can
get by signing up for it at recaptcha.net.  Add this text to your new
js file:

function init()
{
        Recaptcha.create("YOUR_PUBLIC_KEY","recaptcha_div",{ theme:
"clean",callback: Recaptcha.focus_response_field});

}

Step 3:

Go back to your .html file, and modify the <body> tag so that it looks
like this:
<body onload="init()">

Next, put in the div tags between in the body  wherever you see fit:
<div id="recaptcha_div"></div>

When you load your page, you should now see your captcha, but we still
need to get the challenge and response from the captcha.

Step 4:

Time for some JNSI.  Somewhere you will have a widget that is going to
use RPC or a POST method to send the captcha data along with whatever
else (comment/post, signup details, etc.), and you will need to get
the challenge and reponse from the captcha.  In that widget, add the
following two JNSI functions:

        protected native String getResponse()
        /*-{
          return $wnd.Recaptcha.get_response();
        }-*/;

        protected native String getChallenge()
        /*-{
          return $wnd.Recaptcha.get_challenge();
        }-*/;

Call this functions to get the challenge and response, and send them
along to your server.  You can do other crap with the Recaptcha API
using JNSI, just read up on it recaptcha.net.

Step 5:

You are on your own for the server implementation, but you can find
some hints on recaptcha.net

http://recaptcha.net/resources.html

And as always, Google search is your friend :)

-Ben


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TheBuzzer@gmail.com  
View profile  
 More options Apr 28 2008, 4:13 pm
From: "TheBuz...@gmail.com" <TheBuz...@gmail.com>
Date: Mon, 28 Apr 2008 13:13:56 -0700 (PDT)
Local: Mon, Apr 28 2008 4:13 pm
Subject: Re: Recaptcha on GWT
interesting recaptcha makes scanned books readable.

On Apr 27, 1:03 pm, benjo <benejos...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
NN  
View profile  
(1 user)  More options Apr 29 2008, 3:23 pm
From: NN <neh...@gmail.com>
Date: Tue, 29 Apr 2008 12:23:07 -0700 (PDT)
Local: Tues, Apr 29 2008 3:23 pm
Subject: Re: Recaptcha on GWT
I have also created Captcha based on servlets here is the link

http://code.google.com/p/gwtcaptcha/

Cheers,

On Apr 27, 1:03 pm, benjo <benejos...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google