Orbeon Form - reCAPTCHA Field required error after submitting form - recaptcha

I'm struggling to make reCAPTCHA work in my Orbeon form.
I'm using ORBEON 2018.2.3.201905172253 PE within SAP Commerce (Hybris).
After submitting the form, I get the error "Please check your answer to the CAPTCHA challenge" even though the captcha is correct.
Created a common Form and added reCAPTCHA as per official Orbeon documentation: https://doc.orbeon.com/form-runner/component/captcha
Added my private and public keys to the properties file
Added the reCAPTCHA property to my form:
<property
as="xs:string"
name="oxf.fr.detail.captcha.yforms.myForm"
value="reCAPTCHA"/>
This is the process executed when clicking the SUBMIT button:
<property as="xs:string" name="oxf.fr.detail.process.save-final.yforms.myForm">
validate-all
then save
then send(
uri = "https://myurl",
method = "PUT"
)
then navigate(uri = "https://myurl")
</property>
I see the reCAPTCHA at the bottom of my form as expected
When I click SUBMIT after filling up the form and completing the captcha successfully, I see a popup saying "There are validation errors. Please retry once all fields have been properly filled-out."
And the form displays this error for the captcha field:
"Please check your answer to the CAPTCHA challenge."
So I'm clearly missing something. I know there are some configurations needed for the fr-verify-done and fr-verify-error to be added, but the Orbeon documentation does not specify how to configure those through PROPERTIES. They only say how to add those event listeners while adding the captcha component by hand (editing the source code of the form through Form Builder).
Things that I tried and didn't work:
Dispatching an fr-verify event when submitting:
xf:dispatch(name = "fr-verify", targetid = "captcha")
then validate-all
then save
then send(
uri = "https://myurl",
method = "PUT"
)
then navigate(uri = "https://myurl")
Adding the reCAPTCHA component to the form source code as per Orbeon documentation:
<fr:recaptcha id="my-captcha">
<xf:send ev:event="fr-verify-done" submission="save-submission"/>
<xf:action ev:event="fr-verify-error">
<xf:toggle case="failure-case"/>
<xf:dispatch target="my-captcha" name="fr-reload"/>
</xf:action>
</fr:recaptcha>
When I click SAVE after adding the excerpt above, the Form Builder crashes. Same happens if I try to add the same excerpt to a form through the online demo form builder provided by Orbeon : https://demo.orbeon.com/demo/fr/orbeon/builder/new
That is super weird since I'm adding code provided by them using the online last version of the form builder, and it still crashes when trying to save it. So that makes me think the problem I have is not related to my platform, but with Orbeon itself.
This is the error I get in the online demo for Form Builder after adding the recaptcha excerpt to the source code of the form: "Cannot read property 'call' of undefined'
There're no relevant LOGS that I can provide, I activated debug level logs for Orbeon and I'm not getting any useful info.
I would really appreciate if someone can guide me through with either:
- Configuring the fr-verify events without changing the source code of the form using Form Builder, OR
- Adding the reCAPTCHA component through Form Builder successfully without making it crash, OR
- Anything you can come up with to make my form with captcha work
Thanks in advance,
David

SAP Hybris 6.6 includes Orbeon Forms 2017.1.1, which uses Google's reCAPTCHA 1, which Google doesn't support anymore. Your options are either:
To upgrade to a version of SAP Hybris that includes Orbeon Forms 2018.1 or 2017.2.2 or newer (those version use Google's reCAPTCHA 2).
To use the SimpleCaptcha instead of reCAPTCHA.

Related

Outlook Add-in file reading from mail

I am working on a Outlook add-in. I am not able to use the method item.getAttachmentsAsync in my plugin code to load and read the content of files.
I am getting ERROR TypeError: item.getAttachmentsAsync is not a function in run time.
var item = Office.context.mailbox.item;
var options = {asyncContext: {currentItem: item}};
item.getAttachmentsAsync(options, this.callback);
My requirement is explained below,
In the plugin we have a form and few fields are populated from mail body.
And I need mail attachments to auto upload to Form.
Please suggest a better way to do that.
using getAttachmentContentAsync I am able to get the file as a blob. but the problem is we need to call this method as soon after the mail opening. otherwise getting cors error

ABP BoilerPlate: i cant see my exception message when i'm using UserFirendlyException

i'm using ABP ASP boilerplate .net core / angular client side frame work.
i want to show specific message when some condition exists in server side by raising UserFriendlyException("myMessage") but in client side only showing popup window
my end point API signature is like this async Task<BDto> CalcBodies(ADto input)
my problem solved by specifying LocalizationSourceName property of Service instance base on this post : GitHub link

Is it possible to force fail a recaptcha v2 for testing purposes? (I.e. pretend to be a robot)

I'm implementing an invisible reCAPTCHA as per the instructions in the documentation: reCAPTCHA V2 documentation
I've managed to implement it without any problems. But, what I'd like to know is whether I can simulate being a robot for testing purposes?
Is there a way to force the reCAPTCHA to respond as if it thought I was a robot?
Thanks in advance for any assistance.
In the Dev Tools, open Settings, then Devices, add a custom device with any name and user agent equal to Googlebot/2.1.
Finally, in Device Mode, at the left of the top bar, choose the device (the default is Responsive).
You can test the captcha in https://www.google.com/recaptcha/api2/demo?invisible=true
(This is a demo of the Invisible Recaptcha. You can remove the url invisible parameter to test with the captcha button)
You can use a Chrome Plugin like Modify Headers and Add a user-agent like Googlebot/2.1 (+http://www.google.com/bot.html).
For Firefox, if you don't want to install any add-ons, you can easily manually change the user agent :
Enter about:config into the URL box and hit return;
Search for “useragent” (one word), just to check what is already there;
Create a new string (right-click somewhere in the window) titled (i.e. new
preference) “general.useragent.override”, and with string value
"Googlebot/2.1" (or any other you want to test with).
I tried this with Recaptcha v3, and it indeed returns a score of 0.1
And don't forget to remove this line from about:config when done testing !
I found this method here (it is an Apple OS article, but the Firefox method also works for Windows) : http://osxdaily.com/2013/01/16/change-user-agent-chrome-safari-firefox/
I find that if you click on the reCaptcha logo rather than the text box, it tends to fail.
This is because bots detect clickable hitboxes, and since the checkbox is an image, as well as the "I'm not a robot" text, and bots can't process images as text properly, but they CAN process clickable hitboxes, which the reCaptcha tells them to click, it just doesn't tell them where.
Click as far away from the checkbox as possible while keeping your mouse cursor in the reCaptcha. You will then most likely fail it. ( it will just bring up the thing where you have to identify the pictures).
The pictures are on there because like I said, bots can't process images and recognize things like cars.
yes it is possible to force fail a recaptcha v2 for testing purposes.
there are two ways to do that
First way :
you need to have firefox browser for that just make a simple form request
and then wait for response and after getting response click on refresh button firefox will prompt a box saying that " To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier. " then click on "resend"
by doing this browser will send previous " g-recaptcha-response " key and this will fail your recaptcha.
Second way
you can make any simple post request by any application like in linux you can use curl to make post request.
just make sure that you specify all your form filed and also header for request and most important thing POST one field name as " g-recaptcha-response " and give any random value to this field
Just completing the answer of Rafael, follow how to use the plugin
None of proposed answers worked for me. I just wrote a simple Node.js script which opens a browser window with a page. ReCaptcha detects automated browser and shows the challenge. The script is below:
const puppeteer = require('puppeteer');
let testReCaptcha = async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('http://yourpage.com');
};
testReCaptcha();
Don't forget to install puppeteer by running npm i puppeteer and change yourpage.com to your page address

Square payment form cannot execute requestCardNonce() to get nonce in Firefox 48.0.2

I've also submitted a request to Square support and hope to hear back soon.
Steps to reproduce
Load the Square payment form (copy-pasta from https://docs.connect.squareup.com/articles/adding-payment-form/#samplewebpage and add your Application ID and uncomment the lines to submit a request to the server) in Firefox 48.0.2 (latest release as of today). Here's a test URL: https://wideningwontwork.org/test.html
Leave all fields blank.
Click "Submit Query" button.
Expectation
All fields should be highlighted in red to indicate they are required.
Observation
Firefox cannot fire the event requestCardNonce() because it is not defined. Error message in Firefox console:
ReferenceError: event is not defined
requestCardNonce() payment:121
onclick() payment:1
Form is submitted to the server with nonce = "" (empty string or NULL).
Unfortunately, we've published a bug in the documentation We're working on it. Firefox requires an event to be passed as an argument to the function, whereas chrome and safari don't. If you edit the definition of requestCardNonce that you copied from the example to instead be the following, it should work for you:
function requestCardNonce(event) {
event.preventDefault();
paymentForm.requestCardNonce();
}
Notice the event argument. That's the part you have to add. Sorry for the confusion. We'll fix the docs.
edited to include a current screenshot as of 2016-08-31 17:04:43. This is the location in the script where you need to add an event argument to the function definition, and then where you need to provide the event argument to the function call on the submit button.
Having added event in both places, using firefox, I've gotten the following with your test form:

MVC3 + WIF - FederationResult missing "wctx"

I have an MVC3 app for which I want to implement claims support. My goal is as follows:
provide a SignIn link, which when clicked displays a popup window with username/password and Facebook/WindowsLive/Google etc. links
automatically redirect to my SignIn page when a protected controller is accessed e.g. /Order/Delete
I've set up the application and providers in AppFabricLabs.com and included the STS in my project. I've also created an implementation of IAuthorizationFilter so I can mark my controllers as [WifAuth] and successfully get the OnAuthorization method called. I've implemented the use-case where the visitor has not been authenticated like this:
private static void AuthenticateUser(AuthorizationContext context)
{
var fam = FederatedAuthentication.WSFederationAuthenticationModule;
var signIn = new SignInRequestMessage(new Uri(fam.Issuer), fam.Realm);
context.Result = new RedirectResult(signIn.WriteQueryString());
}
and successfully get AppFabricLabs page with my Identity Provider choices (haven't figured out how to customise that page). When I log in my returnUrl gets called so I land in a controller method /Home/FederationResult, however the form posted to me contains only wa and wresult fields but I need wctx to know where to send the user... I haven't been able to figure out why.
the wresult is an XML document that contains (amongst a bzillion other things) the name and e-mail address of the user logging in but sadly does not contain the url to which the user was headed.
have I failed to configure something or am I just off base? thoughts anyone?
e
Just specify a Context for the SignInRequestMessage:
signIn.Context = HttpContext.Current.Request.RawUrl;
The wctx parameter is included in every request/response and also part of the form posted finally to your site.

Resources