AnsweredAssumed Answered

extended login webscript

Question asked by luisg on Aug 7, 2009
Latest reply on Aug 7, 2009 by luisg
Hi all…
I'm developing a Java application that communicates with Alfresco. I'm trying to do my own login webscript:

login.get.desc.xml

<webscript>
  <shortname>Extended Login</shortname>
  <description>Establish a ticket</description>
  <url>/api/login?u={username}&amp;pw={password?}</url>
  <format default="json"/>
  <authentication>none</authentication>
  <transaction allow="readonly">required</transaction>
  <lifecycle>public_api</lifecycle>
  <family>Authentication</family>
</webscript>

login.get.json.ftl

{
   <#if ticket?exists && ticket!="">
      "success":"yes",
      "data": {
         "ticket":"${ticket}"
      }
   <#else>
      "success":"no",
      "errors": {
         "reason":"Invalid username/password!"
      }
   </#if>
}

The thing is, I always get the 'else' result.
What I'm doing wrong?

Thanks

Luis

Outcomes