I've not used the authentication by token extension myself, but regarding using REST - I think you may have missed one important thing. That is:
"As any User, it requires REST Services profile to access the REST API"
So check that your user has "REST Service User" priviledge. Admin role is not enough, maybe not even needed. And also if you plan to modify tickets, you will probably need Support Agent + Service Desk Agent.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That role is already present, forgot to mention that. Still no luck I'm afraid. Is there a logfile I can look in to investigate? If so, where is that located?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I now actually think I see my problem. It seems like the tests I've done using curl had some from formating.. I did:
curl -X POST -F 'version=1.3' -F 'auth_token=xxxxxx' and that failed with Invalid login, but when I did with "-quotes instead it seems to go further giving me some other errorcode due to json formating.. and if I type the wrong token info it fails so I think it's good now. Just need to figure out whats wrong in my json formating. Thanks for all input!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've created a application token in iTop and given it the Rest services user profile. Then I added this config:
adn added token in allowedlogintypes
Is there something else I need to do? I get "Invalid login" when try connecting to the URL
https://myitopurl/ webservices/rest.php
Did you also add other permissions/profiles?
Not sure if there's more extensive debugging you could enable.
I've added the admin role as well. No change I'm affraid. Is there any logs I can look into?
I've not used the authentication by token extension myself, but regarding using REST - I think you may have missed one important thing. That is:
"As any User, it requires REST Services profile to access the REST API"
So check that your user has "REST Service User" priviledge. Admin role is not enough, maybe not even needed. And also if you plan to modify tickets, you will probably need Support Agent + Service Desk Agent.
That role is already present, forgot to mention that. Still no luck I'm afraid. Is there a logfile I can look in to investigate? If so, where is that located?
Hello Niclas,
Try to put "token" first in the "allowedlogintypes" parameter
If it doesn't work, paste a screenshot of the config please.
I now actually think I see my problem. It seems like the tests I've done using curl had some from formating.. I did:
curl -X POST -F 'version=1.3' -F 'auth_token=xxxxxx' and that failed with Invalid login, but when I did with "-quotes instead it seems to go further giving me some other errorcode due to json formating.. and if I type the wrong token info it fails so I think it's good now. Just need to figure out whats wrong in my json formating. Thanks for all input!
Try this:
curl -k -X POST -F 'version=1.3' -F 'auth_token=YOURTOKEN' -F 'json_data={"operation": "core/get","class": "Person","key": "SELECT Person WHERE email LIKE '\''SOME@EMAIL.COM'\''","output_fields":"friendlyname,email"}' "https://SOMESERVER/itop-xxx/webservices/rest.php"
I did get it to work using this:
And the json file contains:
So I think I now got it going :)
Glad to see you fixed it!