Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Facing issue with adding config file for CSRFFilter

Avatar

Level 2

Hi Team,

 

We are working on integrating GraphQL in AEM 6.5.13 (on-prem). To allow graphQL endpoints, we need to add entries in "Adobe Granite CSRF Filter" OSGi configuration.  We have successfully got the things working.

 

Now to deploy the changes in different environments, we were updating the "Adobe Granite CSRF Filter" OSGi configuration via code by adding configuration in "config.author" folder.

 

We are facing an issue as this OSGi configuration is not getting picked. We tried changing other configuration files placed there and all are getting picked and updated successfully.

 

We tried three approaches:

1. com.adobe.granite.csrf.impl.CSRFFilter.xml

2. com.adobe.granite.csrf.impl.CSRFFilter.cfg.json

3. com.adobe.granite.csrf.impl.CSRFFilter.config

 

but none were picked. 

 

Please advise.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @nitish-jain, Welcome to AEM communities.

 

Few tips:

When you edit the configuration directly in your aem instance via osgi, it will create a copy in /apps/system/config.. Can you pls check if both the files are same in pid(filename of the .config file), if not make sure you use same naming and format convention in your checked in file.

 

Second, I believe this service doesn't have factory configuration type, it should be one config for this osgi component in the entire repository, so please cross check if you have this config in any other folders/tenant projects/ or even in /apps/system/config.. you can just search with com.adobe.granite.csrf.impl.CSRFFilter in crx/de you can see results.

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @nitish-jain, Welcome to AEM communities.

 

Few tips:

When you edit the configuration directly in your aem instance via osgi, it will create a copy in /apps/system/config.. Can you pls check if both the files are same in pid(filename of the .config file), if not make sure you use same naming and format convention in your checked in file.

 

Second, I believe this service doesn't have factory configuration type, it should be one config for this osgi component in the entire repository, so please cross check if you have this config in any other folders/tenant projects/ or even in /apps/system/config.. you can just search with com.adobe.granite.csrf.impl.CSRFFilter in crx/de you can see results.

 

Avatar

Level 2

Hi @Shashi_Mulugu ,

 

I did check the path "/apps/system/config" and the file was present with form: com.adobe.granite.csrf.impl.CSRFFilter.config

 

I tried keeping the file in the same format (3rd option from my query) but still, it is not getting picked from the code. I will try again. Thanks for the suggestion.

Avatar

Level 2

Hi @nitish-jain @Shashi_Mulugu 

 

I'm facing same issue, even after keeping same name of the config.

it is not getting picked from the code.

Its prioritized to /apps/system/config path and not our project config path.

 

Can anyone suggest if its resolved?