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.
apiObj = createObject("component","cfide.adminapi.security");
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!
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.
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:
and more on that:
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.