<?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: How do the dropdown and typeahead fields make REST calls? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21543#M9484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just wanted to follow up on this question, Ryan.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Are the user's Alfresco credentials available user side? We want to include REST tasks in our processes that use different authorization headers based on who the process initiator is. How can we do this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jun 2017 17:05:25 GMT</pubDate>
    <dc:creator>jvaidya</dc:creator>
    <dc:date>2017-06-27T17:05:25Z</dc:date>
    <item>
      <title>How do the dropdown and typeahead fields make REST calls?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21540#M9481</link>
      <description>How do the dropdown and typeahead fields make REST calls in Alfresco Process Services, and can users replicate that functionality in custom stencils?&amp;nbsp;Also, is there a way to access Alfresco account information for linked Alfresco accounts in the process for custom REST calls? I know the Folder and F</description>
      <pubDate>Wed, 21 Jun 2017 22:16:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21540#M9481</guid>
      <dc:creator>jvaidya</dc:creator>
      <dc:date>2017-06-21T22:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do the dropdown and typeahead fields make REST calls?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21541#M9482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Presumably part of&amp;nbsp;what you want to do is to make a rest call and use the result in a subsequent step? If so these links may be of help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://docs.alfresco.com/process-services1.6/topics/rest_call_task.html" title="http://docs.alfresco.com/process-services1.6/topics/rest_call_task.html" rel="nofollow noopener noreferrer"&gt;Rest call task | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/thread/225209"&gt;REST Call Task and People form variables in the request&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also choose an endpoint for a typeahead. There's a general rest integration guide in which this is mentioned:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.alfresco.com/community/bpm/blog/2016/08/31/rest-integration-101" rel="nofollow noopener noreferrer"&gt;https://community.alfresco.com/community/bpm/blog/2016/08/31/rest-integration-101&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see from the links, the&amp;nbsp;authentication for an&amp;nbsp;endpoint is configured when you set it up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the alfresco integration, I may be wrong but I don't think there is anything that lets a user be chosen at run-time. I'm only seeing examples where that gets decided at design-time (unless it is the process initiator). The file and folder controls use the authentication set up when the repository was configured in APS. A publish or action step will be carried out as a particular user or as the process initiator. If as a particular user then that is stored in the process definition (in the xml).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you elaborate on your particular use-case that you're trying to work through? Are you, for example, trying to show a drop-down that contains a list of users from an alfresco content repository?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2017 11:12:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21541#M9482</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-06-22T11:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do the dropdown and typeahead fields make REST calls?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21542#M9483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the detailed response, Ryan! I have a couple use cases, but a good example is a custom Alfresco folder selector with search and filter capabilities. I want to use Angular to write a custom form stencil with this field, and somehow call an Alfresco WebScript when the user opens the form. The WebScript will return a list of folders and the form field should use that list to display the folder&amp;nbsp;tree to the user. I could use the Angular controller to perform the REST call, but that leads to CORS issues, and more importantly, the user's Alfresco credentials are not available (as far as I know). It would be ideal if I could get&amp;nbsp;Alfresco&amp;nbsp;credentials based off who is logged in, because that would allow me to authenticate API calls for each user instead of storing the authentication. The Folder form field does this, so I wanted to know if it was possible to replicate this functionality.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've played with REST Tasks before, but that's not exactly what I'm looking for because the user has to submit the form and open a new form to see the results. I'd like to have the REST call happen while the user is looking at the form, for example when a field comes into focus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2017 15:37:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21542#M9483</guid>
      <dc:creator>jvaidya</dc:creator>
      <dc:date>2017-06-22T15:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do the dropdown and typeahead fields make REST calls?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21543#M9484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just wanted to follow up on this question, Ryan.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Are the user's Alfresco credentials available user side? We want to include REST tasks in our processes that use different authorization headers based on who the process initiator is. How can we do this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2017 17:05:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21543#M9484</guid>
      <dc:creator>jvaidya</dc:creator>
      <dc:date>2017-06-27T17:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do the dropdown and typeahead fields make REST calls?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21544#M9485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you're not just looking to get the alfresco credentials of the user that is currently logged in? I ask because that's the credentials that will be used by default anyway when using the built-in components.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have an instance of APS available then you may want to go to the api-explorer.html page and look at the /rest/integration/alfresco endpoints. If the authentication you want isn't available from there then presumably you would need to get it yourself by implementing relevant classes and exposing your own endpoint. Something a bit like this has been done before -&amp;nbsp;&lt;A class="link-titled" href="https://github.com/cijujoseph/activiti-examples/tree/master/activiti-ui-api-proxy" title="https://github.com/cijujoseph/activiti-examples/tree/master/activiti-ui-api-proxy" rel="nofollow noopener noreferrer"&gt;activiti-examples/activiti-ui-api-proxy at master · cijujoseph/activiti-examples · GitHub&lt;/A&gt;&amp;nbsp;. In your case you'd be looking to get details out of APS itself so I think&amp;nbsp;you'd be looking to use the AlfrescoOnPremService and/or UserAccountServiceImpl, if you have access to them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it should be possible to work around CORS. See this page for Alfresco CMS -&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ALFRESCOCORS.md" title="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ALFRESCOCORS.md" rel="nofollow noopener noreferrer"&gt;alfresco-ng2-components/ALFRESCOCORS.md at master · Alfresco/alfresco-ng2-components · GitHub&lt;/A&gt;&amp;nbsp;and this for APS -&amp;nbsp;&lt;A class="link-titled" href="http://docs.alfresco.com/process-services1.6/topics/enabling-cors.html" title="http://docs.alfresco.com/process-services1.6/topics/enabling-cors.html" rel="nofollow noopener noreferrer"&gt;Configuring CORS | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually that CORS page came from the ADF project -&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Alfresco/alfresco-ng2-components" title="https://github.com/Alfresco/alfresco-ng2-components" rel="nofollow noopener noreferrer"&gt;GitHub - Alfresco/alfresco-ng2-components: Alfresco Angular 2 components&lt;/A&gt;&amp;nbsp;. You may want to look at the demos of the ADF components -&amp;nbsp;&lt;A class="link-titled" href="http://devproducts.alfresco.com/" title="http://devproducts.alfresco.com/" rel="nofollow noopener noreferrer"&gt;Alfresco Angular 2 Components Catalog&lt;/A&gt;&amp;nbsp;. If ADF is of interest you could try asking on the ADF gitter channel (linked to from the main ADF github readme).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2017 18:08:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21544#M9485</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-06-27T18:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do the dropdown and typeahead fields make REST calls?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21545#M9486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are looking for the credentials of the user that has logged in, but we wanted to write custom components to&amp;nbsp;add new functionality. So we wanted to use the user's credentials in our API calls.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I looked at the Alfresco endpoints in the API Explorer, and that's somewhat what we want to use, but we were hoping to use a custom WebScript on the Alfresco side for performance reasons. So ideally, we could call our own REST Endpoint using the credentials of the user who has logged in.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2017 18:26:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21545#M9486</guid>
      <dc:creator>jvaidya</dc:creator>
      <dc:date>2017-06-27T18:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do the dropdown and typeahead fields make REST calls?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21546#M9487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually maybe all you need is SSO? Perhaps you could consider using Oath2 (&lt;A class="link-titled" href="http://docs.alfresco.com/process-services1.6/concepts/OAuth-overview.html" title="http://docs.alfresco.com/process-services1.6/concepts/OAuth-overview.html" rel="nofollow noopener noreferrer"&gt;OAuth 2 SSO overview | Alfresco Documentation&lt;/A&gt;&amp;nbsp;) or as of 1.6.3 we aim to add a feature for kerberos. I think that release is due this week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2017 15:42:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-do-the-dropdown-and-typeahead-fields-make-rest-calls/m-p/21546#M9487</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-06-28T15:42:00Z</dc:date>
    </item>
  </channel>
</rss>

