REST Web service Authfail

Moderator: crythias

Post Reply
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

REST Web service Authfail

Post by SuperDOS »

Hi,

Trying the REST Web service but can't figure out how to authenticate.

Imported: https://raw.githubusercontent.com/OTRS/ ... orREST.yml

And use curl "http://helpdesk.company.com/otrs/nph-ge ... d=password"

and get "Error":{"ErrorCode":"TicketGet.AuthFail","ErrorMessage":"TicketGet: Authorization failing!

I've created a agent and use it for auth, is that the right way to do it?
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Re: REST Web service Authfail

Post by SuperDOS »

Tried with the root@localhost account as well but doesn't work either.
Any ideas?
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: REST Web service Authfail

Post by artjoms15 »

With another ssh session take a look with tcpdump -A port 80 if the request sent is well formed.

For me it seems, that you should escape ampersand symbol, when using curl

Code: Select all

curl http://helpdesk.company.com/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/8?UserLogin=User\&Password=password -X GET
A.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Re: REST Web service Authfail

Post by SuperDOS »

ok tried that as well but no luck.

Have also been using advance rest client for chrome to set the password auth in the header but doesn't work either.

Can't figure out what's wrong.

The tcpdump gave no result.
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: REST Web service Authfail

Post by jojo »

Reading a ticket would look like this (GET)

Code: Select all

http://127.0.0.1/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/1?Password=otrs&DynamicFields=0&UserLogin=jojo&AllArticles=0
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
SuperDOS
Znuny newbie
Posts: 93
Joined: 17 Apr 2012, 16:16
Znuny Version: 6.0.3
Real Name: A!

Re: REST Web service Authfail

Post by SuperDOS »

jojo wrote:Reading a ticket would look like this (GET)

Code: Select all

http://127.0.0.1/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/1?Password=otrs&DynamicFields=0&UserLogin=jojo&AllArticles=0
Thanks that works!
Post Reply