Copy link to clipboard
Copied
Hi,
I have been working with the CF admin api on CF 2016 (patch 6) and when I try and do anything with security, datasources, etc I get an error on the CHECKADMINROLES function. I am using the admin user, even tried creating a new user with full access to everything just in case. Anyone know a way around this as the docs are pretty poor.
ERROR:
coldfusion.runtime.CustomException:
at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:3696)
at cfaccessmanager2ecfc293914889$funcCHECKADMINROLES.runFunction(/CFIDE/adminapi/accessmanager.cfc:57)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:492)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
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:3097)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3074)
at cfsecurity2ecfc1515334044$funcSETSECURITYSANDBOX.runFunction(/CFIDE/adminapi/security.cfc:513)
EXAMPLE CODE:
createObject("component","cfide.adminapi.administrator").login("*PASSWORD*", "*USERNAME*");
apiObj = createObject("component","cfide.adminapi.security");
apiObj.setSecuritySandbox(*DIRECTORY*);
Cheers
Copy link to clipboard
Copied
I think this might be a bug in CF but if anyone has CF2016 running, it would be great to see if the same issue occurs. Thank you!
Copy link to clipboard
Copied
Forgot to mention in this I am trying to run this all from the CLI - it works fine running the code via a web URL just not in the CLI. I am presuming this is a security feature but would be good to have a way to access the cf admin api via CLI.
Copy link to clipboard
Copied
Have you confirmed if things work using the same Admin API calls but via a CF template? The CLI is new to CF2016. I have not heard of people using the API there (but I’d expect it to work). If it did NOT work in a regular CFM page, then you know the issue is not about the CLI.
An easy problem would be if you’re not logging in (using the login method of the administrator.cfc). Another challenge is if you are specifying the password but not the username, if your CF Admin username is not the default of “admin”. That’s a choice offered during installation or which can be configured afterward. If you try to login to the Admin UI itself, do you have to provide a username? Do you provide “admin”?
For more docs on the Admin API, see this:
https://helpx.adobe.com/coldfusion/configuring-administering/coldfusion-administrator-api-reference.html#login
and more on that:
http://www.carehart.org/blog/client/index.cfm/2018/1/3/great_start_on_adminapi_docs
/charlie
Copy link to clipboard
Copied
I ran some tests and it appears the CLI doesn't support CF Admin API calls, if you run the same script via a URL it works fine. Unsure if this is something that Adobe has missed or just doesn't want to support.