Hi there,
I'm likely missing something obvious, but am missing something in following the following doc: http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/recaptcha But I'm only getting an unclickable "Complete" button rendered but no recaptcha. What am I missing? So I've got index.xhtml ---------------- <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"> … <xforms:group ref="instance('application-instance')"> <xforms:switch> … <xi:include href="oxf:/path/to/recaptcha.xhtmlf" xxi:omit-xml-base="true"/> </xforms:group> </html> recaptcha.xhtmlf ---------------------- <div xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:ev="http://www.w3.org/2001/xml-events"> <fr:recaptcha id="my-recaptcha"> <fr:public-key ref="instance('config')/public-key"/> <fr:private-key ref="instance('config')/private-key"/> <xforms:action ev:event="fr-verify-error"> <xforms:toggle case="failure-case"/> <xforms:dispatch target="my-captcha" name="fr-reload"/> </xforms:action> <xforms:send ev:event="fr-verify-done" submission="application-create-submission"/> </fr:recaptcha> <xforms:trigger> <xforms:label>Complete</xforms:label> <xforms:dispatch ev:event="DOMActivate" target="my-recaptcha" name="fr-verify"/> </xforms:trigger> </div> model.xml ----------------- <xforms:instance id="config"> <config> <public-key>...</public-key> <private-key>...</private-key> </config> </xforms:instance> cheers, Lachlan -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
I've tried plugging in the body for the recaptcha unit test also.
https://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/xbl/orbeon/recaptcha/recaptcha-unittest.xhtml It renders a button, but the recaptcha box is not visible. Gotta be something obvious but I can't see what I'm missing, cheers. On 16/09/2013, at 11:37 AM, Lachlan Deck <[hidden email]> wrote: > Hi there, > > I'm likely missing something obvious, but am missing something in following the following doc: > http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/recaptcha > > But I'm only getting an unclickable "Complete" button rendered but no recaptcha. > What am I missing? > > > So I've got > index.xhtml > ---------------- > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xmlns:f="http://orbeon.org/oxf/xml/formatting" > xmlns:fr="http://orbeon.org/oxf/xml/form-runner" > xmlns:xi="http://www.w3.org/2001/XInclude" > xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"> > > … > > <xforms:group ref="instance('application-instance')"> > <xforms:switch> > … > <xi:include href="oxf:/path/to/recaptcha.xhtmlf" xxi:omit-xml-base="true"/> > </xforms:group> > </html> > > > recaptcha.xhtmlf > ---------------------- > <div xmlns="http://www.w3.org/1999/xhtml" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:fr="http://orbeon.org/oxf/xml/form-runner" > xmlns:ev="http://www.w3.org/2001/xml-events"> > > <fr:recaptcha id="my-recaptcha"> > <fr:public-key ref="instance('config')/public-key"/> > <fr:private-key ref="instance('config')/private-key"/> > > <xforms:action ev:event="fr-verify-error"> > <xforms:toggle case="failure-case"/> > <xforms:dispatch target="my-captcha" name="fr-reload"/> > </xforms:action> > > <xforms:send ev:event="fr-verify-done" submission="application-create-submission"/> > </fr:recaptcha> > > <xforms:trigger> > <xforms:label>Complete</xforms:label> > <xforms:dispatch ev:event="DOMActivate" target="my-recaptcha" name="fr-verify"/> > </xforms:trigger> > </div> > > model.xml > ----------------- > <xforms:instance id="config"> > <config> > <public-key>...</public-key> > <private-key>...</private-key> > </config> > </xforms:instance> > > cheers, > Lachlan > > -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Just some further info… using the fr:simple-captcha works fine.
So just need a clue on why the fr:recaptcha is not working. cheers
-- On 16/09/2013, at 12:12 PM, Lachlan Deck <[hidden email]> wrote: I've tried plugging in the body for the recaptcha unit test also. You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
So this is happening for a form you created "by hand", not with Form Builder, right? You put snippets in your message, but would you be able to create a full (but still minimal) example, so we can reproduce the issue quickly?
Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Yes that's right, we're not using form builder. I'll try to get an example together in time, but in the meantime I'm using the SimpleCaptcha component -- which is working except I cannot update a value in the model from the result. So I'm trying to control the readonly of the form submission button. The web console shows a 200 is returned for captcha but I can't set the value of Invalid to false or anything else. What am I missing? <xforms:case id="recaptcha-case"> <fr:simple-captcha id="my-simple-captcha"> <fr:public-key ref="instance('config')/public-key"/> <fr:private-key ref="instance('config')/private-key"/> <xforms:action ev:event="fr-verify-done" case="success-case"> <xforms:setvalue ref="instance('control-completion-action')/Invalid" value="false"/> </xforms:action> <xforms:action ev:event="fr-verify-error" case="failure-case"/> </fr:simple-captcha> <!-- The reCAPTCHA component --> <fr:button> <xforms:label>Verify</xforms:label> <xforms:dispatch ev:event="DOMActivate" targetid="my-simple-captcha" name="fr-verify"/> </fr:button> </xforms:case> model.xml -------------- <xforms:instance id="control-completion-action"> <control-completion> <Invalid>true</Invalid> <CompletionTrigger /> </control-completion> </xforms:instance> <xforms:bind nodeset="instance('control-completion-action')"> <xforms:bind nodeset="CompletionTrigger" readonly="instance('control-completion-action')/Invalid"/> </xforms:bind> On 17/09/2013, at 3:07 AM, Alessandro Vernet <[hidden email]> wrote: So this is happening for a form you created "by hand", not with Form Builder, -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
In reply to this post by Alessandro Vernet
Hi Alex,
you should be able to test this quickly (& easily) by taking either of the following pages in the orbeon distribution and visit them via https recapture-noscript-unittest.xhtml recapture-unittest.xhtml changing: http://api-verify.recaptcha.net/verify --> https://api-verify.recaptcha.net/verify I believe the problem is not calling google's apis via https (which I think should be done all the time). On 17/09/2013, at 3:07 AM, Alessandro Vernet <[hidden email]> wrote: > So this is happening for a form you created "by hand", not with Form Builder, > right? You put snippets in your message, but would you be able to create a > full (but still minimal) example, so we can reproduce the issue quickly? > > Alex > > ----- > -- > Follow Orbeon on Twitter: @orbeon > Follow me on Twitter: @avernet > -- > View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657333.html > Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. > > -- > You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. > To post to this group, send email to [hidden email]. -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
And changing <xbl:script src="http://api.recaptcha.net/js/recaptcha_ajax.js"/>
to <xbl:script src="https://api.recaptcha.net/js/recaptcha_ajax.js"/> On 17/09/2013, at 10:17 AM, Lachlan Deck <[hidden email]> wrote: > Hi Alex, > > you should be able to test this quickly (& easily) by taking either of the following pages in the orbeon distribution and visit them via https > > recapture-noscript-unittest.xhtml > recapture-unittest.xhtml > > changing: > http://api-verify.recaptcha.net/verify --> https://api-verify.recaptcha.net/verify > > I believe the problem is not calling google's apis via https (which I think should be done all the time). > > > On 17/09/2013, at 3:07 AM, Alessandro Vernet <[hidden email]> wrote: > >> So this is happening for a form you created "by hand", not with Form Builder, >> right? You put snippets in your message, but would you be able to create a >> full (but still minimal) example, so we can reproduce the issue quickly? >> >> Alex >> >> ----- >> -- >> Follow Orbeon on Twitter: @orbeon >> Follow me on Twitter: @avernet >> -- >> View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657333.html >> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. >> >> -- >> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. >> To post to this group, send email to [hidden email]. > -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Hmm, not sure.
anyway, http doesn't work for me for the following (if hitting an https host) <script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=${instance('config')/public-key}"></script> So it's something along those lines. On 17/09/2013, at 10:20 AM, Lachlan Deck <[hidden email]> wrote: > And changing <xbl:script src="http://api.recaptcha.net/js/recaptcha_ajax.js"/> > to <xbl:script src="https://api.recaptcha.net/js/recaptcha_ajax.js"/> > > On 17/09/2013, at 10:17 AM, Lachlan Deck <[hidden email]> wrote: > >> Hi Alex, >> >> you should be able to test this quickly (& easily) by taking either of the following pages in the orbeon distribution and visit them via https >> >> recapture-noscript-unittest.xhtml >> recapture-unittest.xhtml >> >> changing: >> http://api-verify.recaptcha.net/verify --> https://api-verify.recaptcha.net/verify >> >> I believe the problem is not calling google's apis via https (which I think should be done all the time). >> >> >> On 17/09/2013, at 3:07 AM, Alessandro Vernet <[hidden email]> wrote: >> >>> So this is happening for a form you created "by hand", not with Form Builder, >>> right? You put snippets in your message, but would you be able to create a >>> full (but still minimal) example, so we can reproduce the issue quickly? >>> >>> Alex >>> >>> ----- >>> -- >>> Follow Orbeon on Twitter: @orbeon >>> Follow me on Twitter: @avernet >>> -- >>> View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657333.html >>> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. >>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. >>> To post to this group, send email to [hidden email]. >> > -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
In reply to this post by ldeck
Hey again Alex,
just wondering if you've had a chance to fire up either of the below test cases (from orbeon-resources-private.jar @ /xbl/orbeon/recaptcha/) via https? I believe you'll find that the recaptcha widget doesn't display at all. On 17/09/2013, at 10:17 AM, Lachlan Deck <[hidden email]> wrote: > Hi Alex, > > you should be able to test this quickly (& easily) by taking either of the following pages in the orbeon distribution and visit them via https > > recapture-noscript-unittest.xhtml > recapture-unittest.xhtml > > changing: > http://api-verify.recaptcha.net/verify --> https://api-verify.recaptcha.net/verify > > I believe the problem is not calling google's apis via https (which I think should be done all the time). > > > On 17/09/2013, at 3:07 AM, Alessandro Vernet <[hidden email]> wrote: > >> So this is happening for a form you created "by hand", not with Form Builder, >> right? You put snippets in your message, but would you be able to create a >> full (but still minimal) example, so we can reproduce the issue quickly? >> >> Alex >> >> ----- >> -- >> Follow Orbeon on Twitter: @orbeon >> Follow me on Twitter: @avernet >> -- >> View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657333.html >> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. >> >> -- >> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. >> To post to this group, send email to [hidden email]. > -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Yes, I was able to reproduce this, and created an issue:
https://github.com/orbeon/orbeon-forms/issues/1271 Which depends on: https://github.com/orbeon/orbeon-forms/issues/1270 Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Excellent.
I've added a comment to 1270 that it may be also necessary to look for an x_forwarded_proto header to determine whether http or https is required. But in the meantime, is there a workaround I can apply to the code? cheers, Lachlan On 19/09/2013, at 7:11 AM, Alessandro Vernet <[hidden email]> wrote: > Yes, I was able to reproduce this, and created an issue: > > https://github.com/orbeon/orbeon-forms/issues/1271 > > Which depends on: > > https://github.com/orbeon/orbeon-forms/issues/1270 > > Alex > > ----- > -- > Follow Orbeon on Twitter: @orbeon > Follow me on Twitter: @avernet > -- > View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657347.html > Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. > > -- > You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. > To post to this group, send email to [hidden email]. -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Hi Lachlan,
Thanks for the comment; I didn't know about X-Forwarded-Proto (also mentioned on http://en.wikipedia.org/wiki/List_of_HTTP_header_fields). You could edit recaptcha.xbl, and hardcode https there (where http is now, in <xbl:script src="http://api.recaptcha.net/js/recaptcha_ajax.js"/>). https://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/xbl/orbeon/recaptcha/recaptcha.xbl And if we can do it quickly enough, we'll implement #1270, so that issue can be taken care of in the next release of Orbeon Forms (4.4, maybe 1-2 months from now). Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi again,
I've tried changing both occurrences of "http://api" to "https://api" in recaptcha.xbl But when visiting the page from https, it's not showing up at all. So there must be something else I need to do also as a workaround? Are you able to try this? What other things should I change? cheers Lachlan On 20/09/2013, at 6:54 AM, Alessandro Vernet <[hidden email]> wrote: > Hi Lachlan, > > Thanks for the comment; I didn't know about X-Forwarded-Proto (also > mentioned on http://en.wikipedia.org/wiki/List_of_HTTP_header_fields). > > You could edit recaptcha.xbl, and hardcode https there (where http is now, > in <xbl:script src="http://api.recaptcha.net/js/recaptcha_ajax.js"/>). > > https://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/xbl/orbeon/recaptcha/recaptcha.xbl > > And if we can do it quickly enough, we'll implement #1270, so that issue can > be taken care of in the next release of Orbeon Forms (4.4, maybe 1-2 months > from now). > > Alex > > ----- > -- > Follow Orbeon on Twitter: @orbeon > Follow me on Twitter: @avernet > -- > View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657352.html > Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. > > -- > You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. > To post to this group, send email to [hidden email]. -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Hi Lachlan,
It seems that with HTTPS,we now have to loads the JavaScript from https://www.google.com/recaptcha/api/js/recaptcha_ajax.js. However this is also a new version which creates some cosmetic issues; I added an issue for this, which we can take care of once #1271 is fixed. In the meantime, if you need a solution quickly, you could change the URL in the XBL file, and resolve those CSS issues on your side. https://github.com/orbeon/orbeon-forms/issues/1284 Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
I'll give that a go and report back. Thanks!
On 24/09/2013, at 4:40 AM, Alessandro Vernet <[hidden email]> wrote: > Hi Lachlan, > > It seems that with HTTPS,we now have to loads the JavaScript from > https://www.google.com/recaptcha/api/js/recaptcha_ajax.js. However this is > also a new version which creates some cosmetic issues; I added an issue for > this, which we can take care of once #1271 is fixed. In the meantime, if you > need a solution quickly, you could change the URL in the XBL file, and > resolve those CSS issues on your side. > > https://github.com/orbeon/orbeon-forms/issues/1284 > > Alex > > ----- > -- > Follow Orbeon on Twitter: @orbeon > Follow me on Twitter: @avernet > -- > View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657363.html > Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. > > -- > You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. > To post to this group, send email to [hidden email]. -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Turns out I hadn't been filtering recatpcha.xbl after all. (Whoops)
I've got a custom sbt task tied into that's filtering resources prior to packaging… but recaptcha.xbl was, of course, hidden away in lib/orbeon-resources-private.jar Anyway, so $ jar xf orbeon-resources-private.jar xbl/orbeon/recaptcha $ <editor> xbl/orbeon/recaptcha # edit both script include and verify urls $ jar uf orbeon-resources-private.jar xbl All good. Thanks! I didn't see any styling issues, btw. At least nothing like what you've reported below. On 24/09/2013, at 9:14 AM, Lachlan Deck <[hidden email]> wrote: > I'll give that a go and report back. Thanks! > > On 24/09/2013, at 4:40 AM, Alessandro Vernet <[hidden email]> wrote: > >> Hi Lachlan, >> >> It seems that with HTTPS,we now have to loads the JavaScript from >> https://www.google.com/recaptcha/api/js/recaptcha_ajax.js. However this is >> also a new version which creates some cosmetic issues; I added an issue for >> this, which we can take care of once #1271 is fixed. In the meantime, if you >> need a solution quickly, you could change the URL in the XBL file, and >> resolve those CSS issues on your side. >> >> https://github.com/orbeon/orbeon-forms/issues/1284 >> >> Alex >> >> ----- >> -- >> Follow Orbeon on Twitter: @orbeon >> Follow me on Twitter: @avernet >> -- >> View this message in context: http://discuss.orbeon.com/recaptcha-tp4657327p4657363.html >> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com. >> >> -- >> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. >> To post to this group, send email to [hidden email]. > -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Hi Lachlan,
I'm glad it worked. (And maybe the styling differences are a side effect of recent changes we've done to the CSS.) And now we still have to fix those issues I mentioned, so this works out of the box with HTTPS. Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |