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

Where do I placed my OSGI config (org.apache.sling.security.impl.ReferrerFilter) so it's picked up by both author and publisher?

Avatar

Avatar
Validate 25
Level 4
jayv25585659
Level 4

Likes

46 likes

Total Posts

126 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Validate 25
Level 4
jayv25585659
Level 4

Likes

46 likes

Total Posts

126 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 5
View profile
jayv25585659
Level 4

18-11-2020

as above.

-------

situation:

I want to customize Sling referrer config (org.apache.sling.security.impl.ReferrerFilter) in all environments (author and publishers). I created an XML file with custom config. Thanks

-------

Tests/observations:

1. As a test, I made copies my XML file in these 2 paths
- ui.apps/src/main/content/jcr_root/apps/mysite/config
- ui.apps/src/main/content/jcr_root/apps/mysite/configs/config

After building the code package in my local mac, I then uploaded and installed the code package in the sandbox author but Sling referrer does not show my custom config.
On the sandbox publisher, it's the same situation.

2. Same a test1 except that I removed the XML in the paths mentioned above and place it in this location instead
- ui.apps/src/main/content/jcr_root/apps/mysite/configs/config/config.author

This time it works. I can see my custom config in sandbox author.

3. Same a test1 except that I removed the XML in the paths mentioned above and place it in this location instead
- ui.apps/src/main/content/jcr_root/apps/mysite/configs/config/config.publish

This time it works. I can see my custom config in sandbox publisher.

4. In my local author AEM instance, I can placed the XML file in -any- paths mentioned above and it will work fine.

------------

This is a copy of my OSGI config.

➜ cat org.apache.sling.security.impl.ReferrerFilter.xml

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
allow.hosts="[mysite.my-sso-provider.com,mysite-sandbox.my-sso-provider.com]"/>

-------

background info: We are currently on 6.4.x. We are testing our custom code so we can upgrade to 6.5.x. AMS has provided a sandbox environment (1 author, 1 publisher, 1 dispatcher, 1 load balancer and cloudfront) for us to play around with.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct Reply

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

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct Reply

58 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ankur_Khare
MVP

19-11-2020

keep it under config folder it will be picked by both author and publish .

if its environment specific then keep it like below-

 

config.dev- it would be picked by both dev author and publish

Answers (1)

Answers (1)

Avatar

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

139 likes

Total Posts

188 posts

Correct Reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

139 likes

Total Posts

188 posts

Correct Reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile
Manjunath_K
MVP

18-11-2020

Hi @jayv25585659 

If you want custom OSGI configs to picked up from runmodes then precedence will be as mentioned below

 

irrespective of environments or author/publisher then put config xml under below path.

/project/runmodes/config

 

specific to environment 

/project/runmodes/config.stage

/project/runmodes/config.prod

 

specific to environment + author/publisher

/project/runmodes/config.stage.author

/project/runmodes/config.stage.publish

/project/runmodes/config.prod.author

/project/runmodes/config.prod.publish

 

Hope this helps!