ColdFusion Access Manager Error when attempting to clear trusted cache

耗尽温柔 提交于 2019-12-24 02:13:45

问题


<cfscript>

if (isDefined("url.clearTrustedCache")) {
    clearTrustedCache();
}

function clearTrustedCache() {

    adminObj = createObject("component","cfide.adminapi.administrator");
    adminObj.login("admin");

    runtimeObj = createObject("component","cfide.adminapi.runtime");
    runtimeObj.clearTrustedCache();
}

</cfscript>

I am trying to use the above code to clear the trusted cache via URL param. I am getting the following error message:

The current user is not authorized to invoke this method

The only thing I found online to try was http://helpx.adobe.com/coldfusion/kb/error-current-user-authorized-invoke.html but it didn't work (unless I am doing it incorrectly).

Any thoughts or ideas on how to fix this?


回答1:


The solution was to use a password with the login because it was set up to be required in the Coldfusion Admin. If it's not required in the Coldfusion admin (which I don't recommend then a password may not be necessary.

Example:

adminObj.login("passwordHere","loginHere");



来源:https://stackoverflow.com/questions/14325770/coldfusion-access-manager-error-when-attempting-to-clear-trusted-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!