Unsupported grant_type error

Hi everyone,

I’ve been working with the API and while the password grant type worked correctly I’m getting an error message when using the “authorized_code” grant type. Here is my request:

curl -X POST -u $CLIENT:$SECRET -H “Accept: application/json” $SERVER/uaa/oauth/token -d grant_type=authorized_code -d code=$CODE

And I get the following error:

{“error”:“unsupported_grant_type”,“error_description”:“Unsupported grant type: authorized_code”}

I’ve also tried the $SERVER/token url describe on the documentation but it seems to be incorrect, and i get:

HTTP Status 401 - LDAP authentication is not configured

I’ve been able to retrieve correctly the code but I can’t figure out what am I doing wrong with the request.

Thanks for your time

Eric

Hi

What version of DHIS 2 are you on? also did you configure your oauth2 clients?

Did you test with password based oauth2, is that working fine?

···

On Mon, Apr 11, 2016 at 3:54 AM, eric mourin ericmourin@hotmail.com wrote:

Hi everyone,

I’ve been working with the API and while the password grant type worked correctly I’m getting an error message when using the “authorized_code” grant type. Here is my request:

curl -X POST -u $CLIENT:$SECRET -H “Accept: application/json” $SERVER/uaa/oauth/token -d grant_type=authorized_code -d code=$CODE

And I get the following error:

{“error”:“unsupported_grant_type”,“error_description”:“Unsupported grant type: authorized_code”}

I’ve also tried the $SERVER/token url describe on the documentation but it seems to be incorrect, and i get:

HTTP Status 401 - LDAP authentication is not configured

I’ve been able to retrieve correctly the code but I can’t figure out what am I doing wrong with the request.

Thanks for your time

Eric


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org