problem with macro and signatures

endika cu asked on March 28, 2022 14:29

Hello, I am using a macro but it gives me the following error in the log:

Security check of the expression 'Documents.ClassNames("Table").WithAllData.Where("TableID = 'XXXX'")[0].GetValue("stadium")|(identity)GlobalAdministrator' didn't pass. The signature is not valid.

I have updated the macro signature, but it still gives the same error. The macro works by testing it in " System --> Macro --> Console"

I don't know if it has anything to do with it... but the macro is used in a "Localize" element (it has "|(recursive) true" set, so that's not the problem... the same element has another macro simple ones like "CurrentDocument.DocumentName" which resolves them just fine.

Does anyone have anything else I can try? Thanks a lot

Recent Answers


Dmitry Bastron answered on March 28, 2022 15:11

Hi Endika,

You mentioned you updated the macro signature. Did you go to System > Macro > Signatures, selected both checkboxes ("Old salt: Sign all macros" and "New salt: Use the current salt") and clicked "Update macro signatures"? Were there any errors during this process?

1 votesVote for this answer Mark as a Correct answer

endika cu answered on March 28, 2022 22:08

yes, I have done it several times... and it has not given any error...

Thank you very much for your answer

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 29, 2022 06:55

What version and hotfix are you using and where and how is the macro used/inserted? Are you using web farms, staging, export/import? If yes, check the web.config file and make sure the hash salt string key has the same value for all instances of Kentico.

1 votesVote for this answer Mark as a Correct answer

endika cu answered on April 5, 2022 09:59

I am using version v11.0.1. I'm using staging to go from pre-production to production (even though the macro doesn't work in either place). The only key I see in the web.cofig is CMSHashStringSalt...

Thanks

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 5, 2022 11:37

And is the value of this key the same across all the staging environments?

0 votesVote for this answer Mark as a Correct answer

endika cu answered on April 5, 2022 12:17

yes... is the same.

the macro is set in Localize... I think it has something to do with the fact that signing all the macros again does not "update" something to that macro...

Image Text


0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 5, 2022 12:40

What code or what macro is resolving this nested macro? In other words, how to reproduce the issue in an out of the box instance?

0 votesVote for this answer Mark as a Correct answer

endika cu answered on April 5, 2022 13:47

It is used to write a description dynamically. For example in this URL (Right now the macro is ONLY in the es-ES version):

view-source:https://www.footballhost.com/es/Tickets/FHMatchs/La-Liga-(es)/2022-04-17/La-Liga-Jornada-32-Barcelona-Cadiz

in the image it is seen how it does NOT solve, and in log it gives the initial error.: Image Text

Thank you!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.