<?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 behavior and windows authenticated rest call in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/behavior-and-windows-authenticated-rest-call/m-p/106862#M30169</link>
    <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;This one is unusual so I hope it will be a challenge for alfresco veterans &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I need to make a windows authenticated REST API call from a behavior bound to a onContentRead policy. Windows authentication must be provided from a user that triggered onContentRead event. Is there any possible way to do this?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2019 14:16:52 GMT</pubDate>
    <dc:creator>idomega</dc:creator>
    <dc:date>2019-10-28T14:16:52Z</dc:date>
    <item>
      <title>behavior and windows authenticated rest call</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-and-windows-authenticated-rest-call/m-p/106862#M30169</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;This one is unusual so I hope it will be a challenge for alfresco veterans &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I need to make a windows authenticated REST API call from a behavior bound to a onContentRead policy. Windows authentication must be provided from a user that triggered onContentRead event. Is there any possible way to do this?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 14:16:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-and-windows-authenticated-rest-call/m-p/106862#M30169</guid>
      <dc:creator>idomega</dc:creator>
      <dc:date>2019-10-28T14:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: behavior and windows authenticated rest call</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-and-windows-authenticated-rest-call/m-p/106863#M30170</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Are you trying to call out to an external (non Alfresco API) from within your behavior code? Not quite sure I understand the question here.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Oct 2019 14:37:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-and-windows-authenticated-rest-call/m-p/106863#M30170</guid>
      <dc:creator>jljwoznica</dc:creator>
      <dc:date>2019-10-30T14:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: behavior and windows authenticated rest call</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-and-windows-authenticated-rest-call/m-p/106864#M30171</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry i wasn't clear in the start: I'm trying to call external REST using windows authentication of the user that triggered the event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using AuthenticationUtils and I can get the username of the user that initiated the event but I can't seem to get NTML authentication provider to use with http client making the request.&amp;nbsp;Also, I tried to use the Apache WinHttpCLient to make the REST API call but with no success. This is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;CloseableHttpClient client = WinHttpClients.createDefault();
try {
URI uri = URI.create(uriString);
HttpGet httpGet = new HttpGet(uri);
HttpResponse response = client.execute(httpGet);
HttpEntity responseEntity = response.getEntity();
String responseString = EntityUtils.toString(responseEntity, "UTF-8");
client.close();
return responseString;
} catch (ParseException | IOException e) {
e.printStackTrace();
logger.error("executeImpl Error: " + e.toString());
return "error";
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;It's interesting that the above code works when sending POST to external REST service from the ServiceTask in Process Services (in the implementation of the JavaDelegate interface).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 08:26:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-and-windows-authenticated-rest-call/m-p/106864#M30171</guid>
      <dc:creator>idomega</dc:creator>
      <dc:date>2019-11-04T08:26:54Z</dc:date>
    </item>
  </channel>
</rss>

