Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Hi,
I am trying to implement CSRF token for the form servlet, however I am getting error of "The import com.adobe.granite.csrf cannot be resolvedJava(268435846)" in the servlet.
I have added the dependency to the main pom.xml file:
Os tópicos ajudam a categorizar o conteúdo da comunidade e aumentam sua capacidade de descobrir conteúdo relevante.
Visualizações
respostas
Total de curtidas
Hi @BinaryAlchemy11,
Unfortunately, this com.adobe.granite.csrf package is not exported by any OSGi bundle. You can check it in via /system/console/depfinder and package or class name.
In the provided screenshot you can see that this bundle doesn't export desired package. That's why you can't import it in your bundle.
I'd suggest to create own implementation of CSRF service.
Best regards,
Kostiantyn Diachenko.
This is what I have in depfinder:
Do you have a sample example on creating own implementation of CSRF service?
Or the best practice to validate forms post request in servlet for CSRF attacks?
Visualizações
respostas
Total de curtidas
As far as I know CSRF protection is enabled for forms by default.
Read this documentation:
In addition, you can check the following OSGi configurations that manage CSRF token:
- Adobe Granite CSRF Servlet
- Adobe Granite CSRF Filter
Best regards,
Kostiantyn Diachenko.
Thanks for the info. Do you have adobe documentation link where it mentions that AEM Forms uses CSRF Validation already?
Visualizações
respostas
Total de curtidas
If you go in your local AEM server folder, in the /luanchpad/felix folder, then lookup for bundleXYZ, where XYZ is the ID of the bundle, which in you case is 245, you will find a bundle.jar file. If you look inside the jar, you will see 3 classes:
If these are what you are looking for ? I don't see any com.adobe.granite.csrf.CSRFService.
Oh okay that makes sense. Do you have an example of how you might have used CSRF validation for the form servlet?
Visualizações
respostas
Total de curtidas
@BinaryAlchemy11 Did you find the suggestion helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas