1 Reply Latest reply on Nov 3, 2015 6:23 AM by jesse.fuller

    problem retrieving OAuth Access token for Jive cloud rest api Authentication using Authorization Code

    kevin_gu

      We have a Jive cloud instance authenticating against our ADFS 3.0 server using SAML protocol and it's working fine

      Recently we are trying to access Jive's Rest Api, and we followed the instruction How To Use OAuth 2.0 for REST API Calls  and http://tools.ietf.org/html/rfc6749#section-4.1

       

      First, we created a test addon and installed in Jive, and do /oauth2/authorize as below:

       

      https://spark-otpp.jiveon.com/oauth2/authorize/?client_id=ne6drmhtggo33ryrg9vr12eov4qsuz9l.i&response_type=code

       

      it brings the browser to our ADFS login page which is good, and after login with correct credential we see this (which is also good i believe)

      Capture (2).PNG

       

      after I clicked "allow" it redirect the browser to the desired redirect_url defined in my addon with a pending code (I believe it's the Authorization code)."hsi488fxcu90entxe2xuxqsv5aktoxtw.c"

       

      then i Use the code to do a get:

      https://ne6drmhtggo33ryrg9vr12eov4qsuz9l.i:l4mmoohzv9qsbbuh1vfb02e9fwft441m.s@spark-otpp.jiveon.com/oauth2/token?code=hsi488fxcu90entxe2xuxqsv5aktoxtw.c&grant_type=authorization_code&client_id=ne6drmhtggo33ryrg9vr12eov4qsuz9l.i

      (which is equivalent to curl -u 'ne6drmhtggo33ryrg9vr12eov4qsuz9l.i:l4mmoohzv9qsbbuh1vfb02e9fwft441m.s' -d 'code=hsi488fxcu90entxe2xuxqsv5aktoxtw.c&grant_type=authorization_code&client_id=ne6drmhtggo33ryrg9vr12eov4qsuz9l.i'https://spark-otpp.jiveon.com/oauth2/token )

       

      unfortunately i received:{"error":"unauthorized_client","error_description":"The client failed to authorize"} as below.... I don't know why it says failed to authorize... since I haven't done any rest request yet, what I am doing here is retrieving the token in Authentication process.

      Capture.PNG

       

      now this is blocking our development process for using jive's rest api and I don't know if there is a way to debuy or to know the detail reason for this error.

      Gifford Louie

       

      Thanks

       

      Kevin