Recaptcha: Invalid action name in recaptcha v3

Created on 25 Jun 2020  ยท  2Comments  ยท  Source: google/recaptcha

When I try to check an action in recaptcha v3 and the action name contains a โ€œ-โ€ character, I get the following error:

Invalid action name, may only include "A-Za-z/_". Do not include user-specific information.
Screen Shot 2020-06-26 at 00 12 00

question

Most helpful comment

Thank you for your reply.

The fact is why the โ€œ-" sign is not allowed.

I think that in many projects keys with a โ€œ-โ€ sign are used, which need to be checked.
For example, in our project, when the current path to a location changes, we get a new one and try to check it. But many of them have a โ€œ-โ€ sign.

All 2 comments

I can see how that message might be confusing. Where it's stating A-Z, it means the characters A through to Z. The - is indicating the range and is not a valid character for the action name.

From https://developers.google.com/recaptcha/docs/v3

Actions may only contain alphanumeric characters and slashes, and must not be user-specific.

For example:
โ›” Invalid actions: user-login, comment-add, add-to-cart
โœ”๏ธ Valid actions: user/login, comment/add, add_to_cart

Thank you for your reply.

The fact is why the โ€œ-" sign is not allowed.

I think that in many projects keys with a โ€œ-โ€ sign are used, which need to be checked.
For example, in our project, when the current path to a location changes, we get a new one and try to check it. But many of them have a โ€œ-โ€ sign.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Antaris picture Antaris  ยท  11Comments

edwardsmarkf picture edwardsmarkf  ยท  5Comments

dianeensey picture dianeensey  ยท  3Comments

apriebe picture apriebe  ยท  7Comments

edwolfe3 picture edwolfe3  ยท  10Comments