Integrate Alibaba captcha in AEMaacs | Community
Skip to main content
Level 2
July 26, 2024

Integrate Alibaba captcha in AEMaacs

  • July 26, 2024
  • 2 replies
  • 1590 views

Hi,

 

I have a requirement to integrate Alibaba cloud captcha in AEM sites.

 

I am following the below document for reference. 

 

https://www.alibabacloud.com/help/en/captcha/captcha2-0/user-guide/add-a-web-or-html5-client-to-alibaba-cloud-captcha-2#f2338fd1ee9w6

 

 

But when I try to add the maven dependency for aliyun, I am getting an error in project.all module.

My dependency is:
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>captcha20230305</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>


The error I am getting is:

 


[ERROR] The analyser found the following errors for author and publish :
[ERROR] [api-regions-exportsimports] com.abc:aem-abc-project.core:4.1.0: Bundle aem-abc-project.core:4.1.0 is importing package(s) [com.aliyun.teaopenapi.models, com.aliyun.captcha20230305.models, com.aliyun.captcha20230305] in start level 20 but no bundle is exporting these for that start level. (com.abc:aem-abc-project.all:4.1.0)

 

 

@arunpatidar @lukasz-m @BrianKasingli 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 26, 2024

Hi,


Do you have any specific questions besides whether someone has experience with this product? I have integrated various types of CAPTCHAs besides Google for different sites, and generally, you shouldn't encounter any issues. The documentation looks good. Just keep in mind to load this on demand to avoid performance issues.

Hope this helps

Esteban Bustamante
Level 2
July 29, 2024

Hi @estebanbustamante ,

 

I mean in the document there is not endpoint provided.

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 29, 2024

Just a friendly reminder: this is not an AEM-specific question but a broader question about using Alibaba's captcha. For more detailed assistance, feel free to consult other forums or Alibaba's official support. However, a quick look at the documentation shows that, if you follow the Integration Guide here: Integration Guide, it states that once you purchase the product, you will receive the credentials needed to invoke and verify the captcha.

 

In other words, with the credentials you obtain after purchasing the product, you can use something like this (as shown in the Alibaba documentation):

 

// 1. Integrate the main JavaScript code. <script type="text/javascript" src="https://o.alicdn.com/captcha-frontend/aliyunCaptcha/AliyunCaptcha.js"></script> // 2. Create a <script> tag to call the initializer function initAliyunCaptcha. <script> let captcha; // Pop-up CAPTCHA initAliyunCaptcha({ SceneId: 'c9h3****', // The scenario ID. prefix: '89****', // The identity of the CAPTCHA 2.0 instance that you purchase. mode: 'popup', // The CAPTCHA mode. element: '#captcha-element', button: '#button', // The element that triggers the pop-up CAPTCHA window. captchaVerifyCallback: captchaVerifyCallback, onBizResultCallback: onBizResultCallback, getInstance: getInstance, slideStyle: { width: 360, height: 40, }, language: 'cn', region: 'cn' });

 

The initAliyunCaptcha() from the Alibaba JS framework will verify and validate, so all the calls, endpoints, etc are handled internally for that function. Please check the documentation that explains how to use the callbacks to interact with the verification response (captchaVerifyCallback).


Hope this helps.


 

Esteban Bustamante
kautuk_sahni
Community Manager
Community Manager
August 1, 2024

@src_aem_dev Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni
Level 2
August 2, 2024

Hi @kautuk_sahni , I did not find the solution. I am still facing the same issue regarding the aliyun dependency.

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
August 5, 2024

@src_aem_dev It looks like you have updated the original question, which suggests that your initial query about the JS library has been resolved and you now understand how to use it. If your original question has indeed been resolved, please close this thread and open a new one for the current dependency issue. This approach keeps discussions cleaner and more organized, benefiting all community members.

 

cc: @kautuk_sahni 

Esteban Bustamante