<?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 random authentication error in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/random-authentication-error/m-p/128163#M34767</link>
    <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do the authentication qith my credentials and i obtain correctly the token, but after I&lt;BR /&gt;execute the next operation get with this token I receive response code 401 and 200 with the same request.&lt;BR /&gt;Why I receive sometimes error code 401?&lt;/P&gt;&lt;P&gt;Attach my postman with responses&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alfresco.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1117iE39CF03557925CBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;Regards&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 14:07:49 GMT</pubDate>
    <dc:creator>ipeinad2</dc:creator>
    <dc:date>2021-08-23T14:07:49Z</dc:date>
    <item>
      <title>random authentication error</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/random-authentication-error/m-p/128163#M34767</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do the authentication qith my credentials and i obtain correctly the token, but after I&lt;BR /&gt;execute the next operation get with this token I receive response code 401 and 200 with the same request.&lt;BR /&gt;Why I receive sometimes error code 401?&lt;/P&gt;&lt;P&gt;Attach my postman with responses&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alfresco.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1117iE39CF03557925CBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 14:07:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/random-authentication-error/m-p/128163#M34767</guid>
      <dc:creator>ipeinad2</dc:creator>
      <dc:date>2021-08-23T14:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: random authentication error</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/random-authentication-error/m-p/128164#M34768</link>
      <description>&lt;P&gt;I am not sure what steps you exactly followed but the error you mentioned is something strange.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These are two approaches to work with rest apis:&lt;/P&gt;
&lt;P&gt;1- Get the basic auth base64 encoded string for the user credentials and use it for susequent requests by passing it as auth header. (not recommended)&lt;/P&gt;
&lt;P&gt;2- Use the auth rest api to get the alf_ticket and use it for susequent request as auth header by converting to base64 encoded string. see the example here:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/6.1/develop/rest-api-guide/install/#authenticating-to-get-a-ticket" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/content-services/6.1/develop/rest-api-guide/install/#authenticating-to-get-a-ticket&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/6.1/develop/rest-api-guide/install/#using-the-ticket" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/content-services/6.1/develop/rest-api-guide/install/#using-the-ticket&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$ curl -X GET -H 'Accept: application/json' -H 'Authorization: Basic &lt;SPAN&gt;VElDS0VUXzA4ZWI3ZTJlMmMxNzk2NGNhNTFmMGYzMzE4NmNjMmZjOWQ1NmQ1OTM=&lt;/SPAN&gt;' 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/queries/nodes?term=dog&lt;/PRE&gt;
&lt;P&gt;Can you try the same request via &lt;A href="https://curl.se/" target="_self" rel="nofollow noopener noreferrer"&gt;curl&lt;/A&gt; and see what result you get? if you are using endpoint which is behind LB, then try hitting the nodes one by one and see what response you get.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 16:12:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/random-authentication-error/m-p/128164#M34768</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2021-08-23T16:12:46Z</dc:date>
    </item>
  </channel>
</rss>

