<?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: Opensearch query and Authenticated session with ticket in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233343#M186473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi pmonks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've watched some examples class in the apache component distribution. I've also tried to use them for my purpose. For example I've tried to connect and authenticate to&amp;nbsp; alfresco using ClientAuthentication class, here the principal lines of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultHttpClient httpclient = new DefaultHttpClient();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; httpclient.getCredentialsProvider().setCredentials(new AuthScope("localhost", 8080), new UsernamePasswordCredentials("admin", "admin"));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpGet httpget = new HttpGet("&lt;/SPAN&gt;&lt;A href="http://localhost:8080/alfresco/service/api/search/keyword.rss?q=lingo" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/service/api/search/keyword.rss?q=lingo&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I continue to obtain an http 500 error :"A valid SecureContext was not provided in the RequestContext". Specifing username and password, I was hoping to get an authenticated session, but it is not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried to use the class ClientInteractiveAuthentication but the result is the same. Maybe I'm not using it properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really need advice&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for your valuable help&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Jan 2010 21:07:27 GMT</pubDate>
    <dc:creator>keepcool</dc:creator>
    <dc:date>2010-01-24T21:07:27Z</dc:date>
    <item>
      <title>Opensearch query and Authenticated session with ticket</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233339#M186469</link>
      <description>Hi all,I want my external application gets the content of alfresco repository by querying it. For this reason I use Alfresco Keyword Search to obtain an OpenSearch response from alfesco. To do that first I need to obtain an authenticated session by asking the ticket (because my application is in jav</description>
      <pubDate>Fri, 22 Jan 2010 21:45:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233339#M186469</guid>
      <dc:creator>keepcool</dc:creator>
      <dc:date>2010-01-22T21:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Opensearch query and Authenticated session with ticket</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233340#M186470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For programmatic access to Alfresco it's generally a better idea to use REST (Web Scripts) and authenticate using HTTP Basic Authentication.&amp;nbsp; This is done by accessing Web Scripts via /alfresco/service, and doesn't require an explicit login call, nor does it require ticket management on the calling side.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For your specific case (OpenSearch) there is a REST API (Web Script) included in Alfresco.&amp;nbsp; You'll need to look at the Web Script registry to find it though, as I don't have ready access to an Alfresco instance at the moment to fund it myself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Peter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jan 2010 03:33:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233340#M186470</guid>
      <dc:creator>pmonks</dc:creator>
      <dc:date>2010-01-23T03:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Opensearch query and Authenticated session with ticket</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233341#M186471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Pmonks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;I used the opensearch url template, &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow noopener noreferrer"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;/alfresco/service/api/search/keyword?q={searchTerms}&amp;amp;p={startPage?}&amp;amp;c={count?}&amp;amp;l={language?}, to query "alfresco repository". The problem is that the query returned the http 500 error "A valid SecureContext was not provided in the RequestContext"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide me instructions or examples to implement Http Basic Authentication?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your support&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jan 2010 17:02:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233341#M186471</guid>
      <dc:creator>keepcool</dc:creator>
      <dc:date>2010-01-23T17:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Opensearch query and Authenticated session with ticket</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233342#M186472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HTTP Basic Authentication is defined in RFC2617 (&lt;/SPAN&gt;&lt;A href="http://www.ietf.org/rfc/rfc2617.txt" rel="nofollow noopener noreferrer"&gt;http://www.ietf.org/rfc/rfc2617.txt&lt;/A&gt;&lt;SPAN&gt;).&amp;nbsp; Most HTTP client libraries include native support for it, although Java's java.net.URLConnection class doesn't, so if you're using Java a better bet is the Apache HTTP Client library (&lt;/SPAN&gt;&lt;A href="http://hc.apache.org/" rel="nofollow noopener noreferrer"&gt;http://hc.apache.org/&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Peter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jan 2010 18:03:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233342#M186472</guid>
      <dc:creator>pmonks</dc:creator>
      <dc:date>2010-01-23T18:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Opensearch query and Authenticated session with ticket</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233343#M186473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi pmonks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've watched some examples class in the apache component distribution. I've also tried to use them for my purpose. For example I've tried to connect and authenticate to&amp;nbsp; alfresco using ClientAuthentication class, here the principal lines of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultHttpClient httpclient = new DefaultHttpClient();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; httpclient.getCredentialsProvider().setCredentials(new AuthScope("localhost", 8080), new UsernamePasswordCredentials("admin", "admin"));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpGet httpget = new HttpGet("&lt;/SPAN&gt;&lt;A href="http://localhost:8080/alfresco/service/api/search/keyword.rss?q=lingo" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/service/api/search/keyword.rss?q=lingo&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I continue to obtain an http 500 error :"A valid SecureContext was not provided in the RequestContext". Specifing username and password, I was hoping to get an authenticated session, but it is not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried to use the class ClientInteractiveAuthentication but the result is the same. Maybe I'm not using it properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really need advice&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for your valuable help&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jan 2010 21:07:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233343#M186473</guid>
      <dc:creator>keepcool</dc:creator>
      <dc:date>2010-01-24T21:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Opensearch query and Authenticated session with ticket</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233344#M186474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am the exact same problem. I am also using HttpClient. In my case I'm trying to use the WebDAV component of Alfresco to retrieve content. I keep getting Http 401 error code, which just means that it can't authorize me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code that I'm using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DefaultHttpClient defaultClient = (DefaultHttpClient)client;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;List&amp;lt;String&amp;gt; authTargetSchemes = new ArrayList&amp;lt;String&amp;gt;();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;authTargetSchemes.add(AuthPolicy.BASIC);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;defaultClient.getParams().setParameter("http.auth.target-scheme-pref", authTargetSchemes);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;defaultClient.getParams().setParameter("http.protocol.handle-authentication", true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;defaultClient.getCredentialsProvider().setCredentials(new AuthScope("localhost", "8080", "webdav"),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new UsernamePasswordCredentials(username, password));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;defaultClient.execute(method);&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;/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;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jan 2010 05:54:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/opensearch-query-and-authenticated-session-with-ticket/m-p/233344#M186474</guid>
      <dc:creator>analyzediz</dc:creator>
      <dc:date>2010-01-30T05:54:31Z</dc:date>
    </item>
  </channel>
</rss>

