<?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 Requesting an Access Token with an Authorization Code dont give me a token in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/requesting-an-access-token-with-an-authorization-code-dont-give/m-p/314822#M1823</link>
    <description>&lt;P&gt;hi, i have a problem with the OAuth 2 when i used the rest api just like the document first a create a new entry in the &lt;CODE&gt;oauth2Clients&lt;/CODE&gt; directory, for instance with &lt;CODE&gt;curl&lt;/CODE&gt; using this:&lt;/P&gt;
&lt;P&gt;curl -u Administrator:Administrator \ -H 'Content-Type: application/json' \ -X POST &lt;A href="http://NUXEO_SERVER/nuxeo/api/v1/directory/oauth2Clients" target="test_blank"&gt;http://NUXEO_SERVER/nuxeo/api/v1/directory/oauth2Clients&lt;/A&gt; \ -d @- &amp;lt;&amp;lt; EOF { "entity-type": "directoryEntry", "directoryName": "oauth2Clients", "properties": { "name": "My App", "clientId": "myApp", "clientSecret": "secret", "redirectURIs": "https://myapp.mydomain.com/nuxeo-auth-done", "autoGrant": "true", "enabled": "true" } } EOF&lt;/P&gt;
&lt;P&gt;when i used the get in CURL authorization endpoint
GET &lt;A href="https://NUXEO_SERVER/nuxeo/oauth2/authorize?response_type=code&amp;amp;client_id=myApp" target="test_blank"&gt;https://NUXEO_SERVER/nuxeo/oauth2/authorize?response_type=code&amp;amp;client_id=myApp&lt;/A&gt;
the GET return nothing
but... when i used intere link in my browser works fine and in the url give a like &amp;amp;code=KEDsdlodk (is a random code)
when i used the code in the ### Requesting an Access Token with an Authorization Code and put de curl with:
POST &lt;A href="https://NUXEO_SERVER/nuxeo/oauth2/token?grant_type=authorization_code&amp;amp;client_id=myApp&amp;amp;code=authorizationCode" target="test_blank"&gt;https://NUXEO_SERVER/nuxeo/oauth2/token?grant_type=authorization_code&amp;amp;client_id=myApp&amp;amp;code=authorizationCode&lt;/A&gt;
return me invalid authorization code; error: invalid_grant
im doing something wrong? check the images in the post pls, if anyone know about this let me know and thanks for the help&lt;/P&gt;
&lt;P&gt;Sorry for my english is a little bad :c&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 11:04:07 GMT</pubDate>
    <dc:creator>Emilio_Moreno</dc:creator>
    <dc:date>2021-03-19T11:04:07Z</dc:date>
    <item>
      <title>Requesting an Access Token with an Authorization Code dont give me a token</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/requesting-an-access-token-with-an-authorization-code-dont-give/m-p/314822#M1823</link>
      <description>&lt;P&gt;hi, i have a problem with the OAuth 2 when i used the rest api just like the document first a create a new entry in the &lt;CODE&gt;oauth2Clients&lt;/CODE&gt; directory, for instance with &lt;CODE&gt;curl&lt;/CODE&gt; using this:&lt;/P&gt;
&lt;P&gt;curl -u Administrator:Administrator \ -H 'Content-Type: application/json' \ -X POST &lt;A href="http://NUXEO_SERVER/nuxeo/api/v1/directory/oauth2Clients" target="test_blank"&gt;http://NUXEO_SERVER/nuxeo/api/v1/directory/oauth2Clients&lt;/A&gt; \ -d @- &amp;lt;&amp;lt; EOF { "entity-type": "directoryEntry", "directoryName": "oauth2Clients", "properties": { "name": "My App", "clientId": "myApp", "clientSecret": "secret", "redirectURIs": "https://myapp.mydomain.com/nuxeo-auth-done", "autoGrant": "true", "enabled": "true" } } EOF&lt;/P&gt;
&lt;P&gt;when i used the get in CURL authorization endpoint
GET &lt;A href="https://NUXEO_SERVER/nuxeo/oauth2/authorize?response_type=code&amp;amp;client_id=myApp" target="test_blank"&gt;https://NUXEO_SERVER/nuxeo/oauth2/authorize?response_type=code&amp;amp;client_id=myApp&lt;/A&gt;
the GET return nothing
but... when i used intere link in my browser works fine and in the url give a like &amp;amp;code=KEDsdlodk (is a random code)
when i used the code in the ### Requesting an Access Token with an Authorization Code and put de curl with:
POST &lt;A href="https://NUXEO_SERVER/nuxeo/oauth2/token?grant_type=authorization_code&amp;amp;client_id=myApp&amp;amp;code=authorizationCode" target="test_blank"&gt;https://NUXEO_SERVER/nuxeo/oauth2/token?grant_type=authorization_code&amp;amp;client_id=myApp&amp;amp;code=authorizationCode&lt;/A&gt;
return me invalid authorization code; error: invalid_grant
im doing something wrong? check the images in the post pls, if anyone know about this let me know and thanks for the help&lt;/P&gt;
&lt;P&gt;Sorry for my english is a little bad :c&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 11:04:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/requesting-an-access-token-with-an-authorization-code-dont-give/m-p/314822#M1823</guid>
      <dc:creator>Emilio_Moreno</dc:creator>
      <dc:date>2021-03-19T11:04:07Z</dc:date>
    </item>
  </channel>
</rss>

