<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: C# POST and Authentication in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194764#M147894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;cfhttp url="#APPLICATION.alfrescoRoot#/service/api/login?u=#APPLICATION.alfrescoUsername#&amp;amp;pw=#APPLICATION.alfrescoPassword#" method="GET"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;cfset myTicket = XMLParse(CFHTTP.FileContent).ticket.XmlText&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;cfhttp url="&lt;A href="http://localhost:8080/alfresco/upload/test.pdf?ticket=#myTicket#" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/upload/test.pdf?ticket=#myTicket#&lt;/A&gt;" method="put"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;cfhttpparam type="file" name="myFile" file="C:\test.pdf"&amp;gt;&lt;BR /&gt;&amp;lt;/cfhttp&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Although the above is in ColdFusion and not C#, it should be a decent enough example. Basically you make an HTTP call to the alfresco server @ &lt;/SPAN&gt;&lt;A href="http://serveraddress:8080/alfresco/service/api/login?u=username&amp;amp;pw=password" rel="nofollow noopener noreferrer"&gt;http://serveraddress:8080/alfresco/service/api/login?u=username&amp;amp;pw=password&lt;/A&gt;&lt;SPAN&gt; with some real credentials, and the server will respond back with XML that contains a ticket. Append that ticket at the end of your requests with "&amp;amp;alf_ticket=whatvertheticketis" and you won't need to pass the credentials in the header.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: the UploadContentServlet expects the url arg as "ticket" whilst the other services use "alf_ticket"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Feb 2009 20:25:20 GMT</pubDate>
    <dc:creator>ejholmgren</dc:creator>
    <dc:date>2009-02-10T20:25:20Z</dc:date>
    <item>
      <title>C# POST and Authentication</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194761#M147891</link>
      <description>Here's a weird one. I'm POSTing content to a Web Script using C# and UploadData. The content comes to the C# method as bytes (not a file reference). UploadData in C# allows me to Authenticate, POST metadata and the content all in one call, which is great. However, if the web script requires authenti</description>
      <pubDate>Tue, 10 Feb 2009 15:19:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194761#M147891</guid>
      <dc:creator>holein1</dc:creator>
      <dc:date>2009-02-10T15:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: C# POST and Authentication</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194762#M147892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried using a ticket appended to the url for authentication instead?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 18:21:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194762#M147892</guid>
      <dc:creator>ejholmgren</dc:creator>
      <dc:date>2009-02-10T18:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: C# POST and Authentication</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194763#M147893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No I haven't. Can you elaborate? I'm not familiar with what you're suggesting.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 19:18:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194763#M147893</guid>
      <dc:creator>holein1</dc:creator>
      <dc:date>2009-02-10T19:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: C# POST and Authentication</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194764#M147894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;cfhttp url="#APPLICATION.alfrescoRoot#/service/api/login?u=#APPLICATION.alfrescoUsername#&amp;amp;pw=#APPLICATION.alfrescoPassword#" method="GET"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;cfset myTicket = XMLParse(CFHTTP.FileContent).ticket.XmlText&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;cfhttp url="&lt;A href="http://localhost:8080/alfresco/upload/test.pdf?ticket=#myTicket#" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/upload/test.pdf?ticket=#myTicket#&lt;/A&gt;" method="put"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;cfhttpparam type="file" name="myFile" file="C:\test.pdf"&amp;gt;&lt;BR /&gt;&amp;lt;/cfhttp&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Although the above is in ColdFusion and not C#, it should be a decent enough example. Basically you make an HTTP call to the alfresco server @ &lt;/SPAN&gt;&lt;A href="http://serveraddress:8080/alfresco/service/api/login?u=username&amp;amp;pw=password" rel="nofollow noopener noreferrer"&gt;http://serveraddress:8080/alfresco/service/api/login?u=username&amp;amp;pw=password&lt;/A&gt;&lt;SPAN&gt; with some real credentials, and the server will respond back with XML that contains a ticket. Append that ticket at the end of your requests with "&amp;amp;alf_ticket=whatvertheticketis" and you won't need to pass the credentials in the header.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: the UploadContentServlet expects the url arg as "ticket" whilst the other services use "alf_ticket"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 20:25:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194764#M147894</guid>
      <dc:creator>ejholmgren</dc:creator>
      <dc:date>2009-02-10T20:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: C# POST and Authentication</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194765#M147895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That worked great! Now I just request a ticket, send it along with the upload POST, and forget about setting credentials.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I need to delete the ticket after I'm done with it or does it matter? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 16:21:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194765#M147895</guid>
      <dc:creator>holein1</dc:creator>
      <dc:date>2009-02-11T16:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: C# POST and Authentication</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194766#M147896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No idea :mrgreen: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm guessing if you had a massive amount of transactions going on, you'd hit some sort of limit if you left them all open until they expired.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Consequently, you can easily close a ticket with an HTTP DELETE call to &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;A _jive_internal="true" href="https://community.alfresco.com/server:port/alfresco/service/api/login/ticket/APPEND_TICKET_HERE" rel="nofollow noopener noreferrer"&gt;http://server:port/alfresco/service/api/login/ticket/APPEND_TICKET_HERE&lt;/A&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 20:12:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/c-post-and-authentication/m-p/194766#M147896</guid>
      <dc:creator>ejholmgren</dc:creator>
      <dc:date>2009-02-11T20:12:40Z</dc:date>
    </item>
  </channel>
</rss>

