<?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: Cloud API, Oauth tokens in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298849#M251979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;…make sure that you:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(1) Have registered for an API key at &lt;/SPAN&gt;&lt;A href="http://www.alfresco.com/develop" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.com/develop&lt;/A&gt;&lt;SPAN&gt; and you've obtained your secret and your API key and have placed them in config.properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(2) When your browser launches so that Alfresco can ask you to grant access to your account, make sure you are logging in using your Alfresco in the cloud account. The username and password for that account are completely different credentials than what you use to log in to the Alfresco developer portal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another thing to try is when the code runs, you should be seeing an access token in the System console. You can grab that and then use an HTTP client to hit the same URL the code is hitting. Just add the access token in the Authorization header, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Authorization: Bearer 00000000-0000-0000-0000-000000000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where that string of zero's is the access token you copied from the system console.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you aren't getting as far as seeing the access token, then I suspect you aren't entering the api key or secret correctly or your callback URL doesn't match up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2013 14:04:35 GMT</pubDate>
    <dc:creator>jpotts</dc:creator>
    <dc:date>2013-10-21T14:04:35Z</dc:date>
    <item>
      <title>Cloud API, Oauth tokens</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298846#M251976</link>
      <description>Hello,I am new to alfresco, and to oauth authentication in general. I'm working with another person who wants to make use of alfresco in the cloud, and have been asked to program the client. I've had issues with Jeff Potts's alfresco api java examples on google code throwing random errors that don't</description>
      <pubDate>Sun, 20 Oct 2013 02:43:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298846#M251976</guid>
      <dc:creator>vsams14</dc:creator>
      <dc:date>2013-10-20T02:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud API, Oauth tokens</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298847#M251977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It would help me improve those API examples if you'd let me know specifically what errors you are seeing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The choice of OAuth client is totally up you to, but if the examples that use the Google OAuth2 library aren't working for you, you might take a look at Jared Ottley's Spring Social plug-in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/Alfresco/spring-social-alfresco" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/spring-social-alfresco&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And you might also take a look at Gethin James' example here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/Alfresco/alfresco-oauth-sample" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/alfresco-oauth-sample&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Oct 2013 23:34:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298847#M251977</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2013-10-20T23:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud API, Oauth tokens</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298848#M251978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, there are definitely less errors now than before the update. Thanks for that by the way. Maven works great now and all code references seem to work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run "GetSitesExample", I get this as the output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;java.net.ConnectException: Connection refused: connect&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Done!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.AbstractPlainSocketImpl.connect(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.PlainSocketImpl.connect(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.SocksSocketImpl.connect(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.Socket.connect(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.NetworkClient.doConnect(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.http.HttpClient.openServer" rel="nofollow noopener noreferrer"&gt;www.http.HttpClient.openServer&lt;/A&gt;&lt;SPAN&gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.http.HttpClient.openServer" rel="nofollow noopener noreferrer"&gt;www.http.HttpClient.openServer&lt;/A&gt;&lt;SPAN&gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.http.HttpClient" rel="nofollow noopener noreferrer"&gt;www.http.HttpClient&lt;/A&gt;&lt;SPAN&gt;.&amp;lt;init&amp;gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.http.HttpClient.New" rel="nofollow noopener noreferrer"&gt;www.http.HttpClient.New&lt;/A&gt;&lt;SPAN&gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.http.HttpClient.New" rel="nofollow noopener noreferrer"&gt;www.http.HttpClient.New&lt;/A&gt;&lt;SPAN&gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.protocol.http.HttpURLConnection.getNewHttpClient" rel="nofollow noopener noreferrer"&gt;www.protocol.http.HttpURLConnection.getNewHttpClient&lt;/A&gt;&lt;SPAN&gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.protocol.http.HttpURLConnection.plainConnect" rel="nofollow noopener noreferrer"&gt;www.protocol.http.HttpURLConnection.plainConnect&lt;/A&gt;&lt;SPAN&gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at sun.net.&lt;/SPAN&gt;&lt;A href="http://www.protocol.http.HttpURLConnection.connect" rel="nofollow noopener noreferrer"&gt;www.protocol.http.HttpURLConnection.connect&lt;/A&gt;&lt;SPAN&gt;(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:93)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:964)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.alfresco.api.example.BasePublicAPIExample.getHomeNetwork(BasePublicAPIExample.java:82)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.alfresco.api.example.GetSitesExample.doExample(GetSitesExample.java:27)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.alfresco.api.example.GetSitesExample.main(GetSitesExample.java:21)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like I said, I hadn't done any work with oauth before this, and I honestly didn't even realise that there was a library being used to implement it. I guess with your example code pulling a very large number of libraries, it was hard to tell which one was relevant and being used for this function, if any. I'll look into google's library and hopefully get it to connect. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Val&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 02:34:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298848#M251978</guid>
      <dc:creator>vsams14</dc:creator>
      <dc:date>2013-10-21T02:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud API, Oauth tokens</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298849#M251979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;…make sure that you:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(1) Have registered for an API key at &lt;/SPAN&gt;&lt;A href="http://www.alfresco.com/develop" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.com/develop&lt;/A&gt;&lt;SPAN&gt; and you've obtained your secret and your API key and have placed them in config.properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(2) When your browser launches so that Alfresco can ask you to grant access to your account, make sure you are logging in using your Alfresco in the cloud account. The username and password for that account are completely different credentials than what you use to log in to the Alfresco developer portal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another thing to try is when the code runs, you should be seeing an access token in the System console. You can grab that and then use an HTTP client to hit the same URL the code is hitting. Just add the access token in the Authorization header, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Authorization: Bearer 00000000-0000-0000-0000-000000000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where that string of zero's is the access token you copied from the system console.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you aren't getting as far as seeing the access token, then I suspect you aren't entering the api key or secret correctly or your callback URL doesn't match up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 14:04:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298849#M251979</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2013-10-21T14:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud API, Oauth tokens</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298850#M251980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;…but I have made sure that the api key and secret, as well as the callback url are all set correctly. The browser does not open. No token comes up in the console. What could be causing this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Val&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 02:06:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cloud-api-oauth-tokens/m-p/298850#M251980</guid>
      <dc:creator>vsams14</dc:creator>
      <dc:date>2013-10-22T02:06:36Z</dc:date>
    </item>
  </channel>
</rss>

