Last active
July 10, 2017 09:44
-
-
Save wilgeno/e85dfd15522add4db8e1d1bc1a427af9 to your computer and use it in GitHub Desktop.
CF 2016 clearTrustedCache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
adminUser = "admin"; | |
adminPW = "password"; | |
thefile = "/absolute/path/to/file.cfm"; | |
adminObj = createObject("component","cfide.adminapi.administrator"); | |
adminObj.login(adminPW, adminUser); | |
adminRuntime = createObject("component","cfide.adminapi.runtime"); | |
adminRuntime.clearTrustedCache(thefile); | |
</cfscript> |
The code is the stripped down and sanitized version of what is failing. The code fails at line 7 of the above code when on the production server.
Inside CF 2016 - Administrator \ security \ usermanager
Create a new user and give him API privileges and i got it to work with that user. The default admin did not work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
coldfusion.security.SecurityManager$UnauthenticatedCredentialsException
at coldfusion.security.SecurityManager.authenticateAdmin(SecurityManager.java:2474)
at coldfusion.runtime.RuntimeServiceImpl.clearTemplateListFromCache(RuntimeServiceImpl.java:2068)
at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at coldfusion.runtime.StructBean.invoke(StructBean.java:508)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3168)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3068)
at cfruntime2ecfc902273094$funcCLEARTRUSTEDCACHE.runFunction(/CFIDE/adminapi/runtime.cfc:886)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:492)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:425)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:388)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:339)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:234)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:650)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:439)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:409)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3091)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3068)
at cfapifacade2ecfc220263449$funcCLEARTRUSTEDCACHE.runFunction(E:\ColdFusion2016\cfusion\wwwroot\CFIDE\adminapi\clearTrustedCache\apifacade.cfc:86)
Line 86 in the stack trace is the same as line 7 in the code above.