Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

google reCaptcha configuration for multiple website pattern

Avatar

Avatar
Validate 1
Level 1
karthik4
Level 1

Likes

2 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
karthik4
Level 1

Likes

2 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
karthik4
Level 1

24-04-2020

Hello, 

I have 3 Websites hosted on my AEM platform, each using Google reCaptcha.  Each website are completely different, but they use the similar service Google reCaptcha service. Each website has their own separate "public key".

 

What is the best way to configure each website, so that the keys are only expose to specific websites? OSGI configurations, configuration on the recaptcha component, configuration in page properties, etc?

 

Whats the best practice, please help?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 3
andyshreve
Level 3

Likes

15 likes

Total Posts

39 posts

Correct Reply

10 solutions
Top badges earned
Validate 10
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 10
Level 3
andyshreve
Level 3

Likes

15 likes

Total Posts

39 posts

Correct Reply

10 solutions
Top badges earned
Validate 10
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
andyshreve
Level 3

24-04-2020

A basic approach that I've seen used successfully is to put a site-specific property at the root page of the site, like at /content/site1/en_us, and then adjust the component to inherit that property using InheritanceValueMap like this:

InheritanceValueMap ivmap = new ComponentInheritanceValueMap(resource);
String captchakey = ivmap.getInherited("captchakey", String.class);

 

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,429 likes

Total Posts

3,304 posts

Correct Reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,429 likes

Total Posts

3,304 posts

Correct Reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

25-04-2020

you can go for context-aware config as well or stores as OSGi factory config and read factory config based on site.

 

CAC

https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configurati...