<?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 Alfresco - Authentication token/ticket httprequest in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-authentication-token-ticket-httprequest/m-p/311558#M264688</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to access a file that I have on Alfresco, but I always get a 401 error - Unauthorized.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;URL url = new URL (filepath);&lt;BR /&gt;String userPassword = user + ":" + password;&lt;BR /&gt;String encoding = new sun.misc.BASE64Encoder().encode(userPassword.getBytes());&lt;BR /&gt;URLConnection connection = url.openConnection();&lt;BR /&gt;uc.setRequestProperty("Authorization", "Basic " + encoding);&lt;BR /&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;BR /&gt;&lt;SPAN&gt;Then I use connection.getURL() and I open the stream to download the file into a byte[].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the string userPassword cannot be accessed like this because I don't need to have access to the user and password of the current client that accesses the file. How can I get one token or something else to get authorization?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I make a javascript with connector.get (I think it's the same) but in java I don't find anything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And other question, after making some modifications, as I return to update the same file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: my question is not duplicated because I don't want to give username and password in the java code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Nov 2015 20:22:20 GMT</pubDate>
    <dc:creator>pat9rv3sousa</dc:creator>
    <dc:date>2015-11-20T20:22:20Z</dc:date>
    <item>
      <title>Alfresco - Authentication token/ticket httprequest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-authentication-token-ticket-httprequest/m-p/311558#M264688</link>
      <description>I'm trying to access a file that I have on Alfresco, but I always get a 401 error - Unauthorized.I'm trying to do something like this:URL url = new URL (filepath);String userPassword = user + ":" + password;String encoding = new sun.misc.BASE64Encoder().encode(userPassword.getBytes());URLConnection</description>
      <pubDate>Fri, 20 Nov 2015 20:22:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-authentication-token-ticket-httprequest/m-p/311558#M264688</guid>
      <dc:creator>pat9rv3sousa</dc:creator>
      <dc:date>2015-11-20T20:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco - Authentication token/ticket httprequest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-authentication-token-ticket-httprequest/m-p/311559#M264689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Why don't use the OpenCMIS Client library?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OpenCMIS allows you to connect with your Alfresco and then manage your contents using a standard protocol without reinventing the wheel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You practically have a Java stub for all the basics operations against the repository:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://chemistry.apache.org/java/download.html" rel="nofollow noopener noreferrer"&gt;https://chemistry.apache.org/java/download.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 11:44:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-authentication-token-ticket-httprequest/m-p/311559#M264689</guid>
      <dc:creator>openpj</dc:creator>
      <dc:date>2015-11-27T11:44:41Z</dc:date>
    </item>
  </channel>
</rss>

