[SOLVED] Link to Customer Panel

English! place to talk about development, programming and coding
Post Reply
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

[SOLVED] Link to Customer Panel

Post by baldassare »

Hi,
I am developing an application that uses SOAP calls for customer creation and for ticket creation. That application also shows the ticket list opened by the customer and other information (such as date, time, ticket number etc).
Is possible to generate a link that open the customer page and authenticate him automatically?

Thanks in advance
BG
Last edited by baldassare on 27 Mar 2014, 12:11, edited 1 time in total.
-BG-
  • programmer
    web developer
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Link to Customer Panel

Post by jojo »

you can get this information via SOAP
"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
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

Re: Link to Customer Panel

Post by baldassare »

Thank you..can you be more specific?
What SOAP call I have to use?
-BG-
  • programmer
    web developer
ThorstenEckel
Znuny newbie
Posts: 24
Joined: 18 Dec 2013, 16:57
Znuny Version: *.*.*
Company: Znuny GmbH
Location: Berlin
Contact:

Re: Link to Customer Panel

Post by ThorstenEckel »

Hi baldassare,

you can use the SessionCreate ( see # Kernel/GenericInterface/Operation/Session/SessionCreate.pm ) backend functionality of the GenericInterface. You have to configure a Provider that uses that backend. After that you can send the following data to the Provider:

Code: Select all

            UserLogin         => 'Agent1',
            CustomerUserLogin => 'Customer1',       # optional, provide UserLogin or CustomerUserLogin
            Password          => 'some password',   # plain text password
that will return a session id:

Code: Select all

            SessionID => $SessionID,
With this session id you can call the customer.pl of your OTRS instance. You need to give the right session parameter name and the value, for instance:

Code: Select all

https://your.otrs.tld/otrs/customer.pl?OTRSCustomerInterface=*generated session id*
The name of the session id parameter can be found in the SysConfig 'CustomerPanelSessionName'.

With that the customer user will be automaticall logged in.
Znuny4OTRS Extensions auf Github: https://github.com/znuny/
Znuny4OTRS - intl. Enterprise Services: https://znuny.com
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

Re: Link to Customer Panel

Post by baldassare »

Thank you for your help,
using "CreateSessionID" I receive an ID and I can see from admin backend the session created. When I click on the link generated as you suggest

echo "<a href='http://xxxxxxxx/otrs/customer.pl?OTRSCustomerInterface=" . $SessionID . "'>test</a>";

the page opened is the login page with the message "Session not valid, please login". The session listed in the admin backend show 2 empty fields on the session created ( the empty fields are type and user ), that's weird because with CreateSessionID I pass the fields requested. :shock:

Any suggest?

Thanks
BG
-BG-
  • programmer
    web developer
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

[SOLVED] Re: Link to Customer Panel

Post by baldassare »

Hi everybody,
I solved my problem.
I was creating the session with the API method CreateSessionID passing UserLogin and UserEmail but, generating a link like this (PHP language)

Code: Select all

echo "<a href='http://xxxxxxxxxxx/otrs/customer.pl?OTRSCustomerInterface=" . $SessionID . ";Action=CustomerTicketOverview;Subaction=MyTickets'>test</a>";
($SessionID was returned by CreateSessionID API call) and clicking on it, the page opened return the message error "Session expired. Please login". I search on the API list (they are not very well documented imho :( ) and found the API method UpdateSessionID that need as parameters the SessionID (returned by CreateSessionID) and key / value of the parameter that you want to update. The parameter to update for make a valid session was UserSessionStart with a current $time.

I use API through SOAP so my metho call was something like this:

Code: Select all

$client->__soapCall("Dispatch",
			array($otrs_soap_username, $otrs_soap_password,
			"SessionObject",     "UpdateSessionID",
			"SessionID", $SessionID,
			"Key",         "UserSessionStart",
			"Value", 	     $Time
		)); 
I hope this help.

Have a nice day
BG
-BG-
  • programmer
    web developer
Post Reply