1 Reply Latest reply on Sep 30, 2016 11:01 AM by Ryan Rutan

    Not able to get token and refresh token

    tripti

      Hi,

       

      I am following the Jive documentation OAuth 2.0 to get Rest API connection using Oauth2

      I created a addon using Oauth2.0 builder. Installed uploaded the addon and got the ClientId and ClientSecret.

      Used <jive-url>/oauth2/authorize?client_id=<client_id>&response_type=code in my browser and got the authorization code

       

      Now I am using Pragmatic Works Task Factory to get the access token and refresh token

       

      Client Id / Api Key                                      = <Client_id>

      Client Secret / Api Secret                          = <Client Secret>

      Authorization Request URL                       = <jive-url>/oauth2/authorize?Client_Id=<Client_id>

      Grant / Response Code Parameter           = Code

      Access token request url                          = <jive-url>/oauth2/token

      Access token request url query string      = code=<authz_code>&grant_type=authorization_code&client_id=<Client_id>

       

      I am using POST method, to get the token

       

      But it does not return me the token and refresh token

      rather redirects me to my adfs/login screen

       

      Can somebody help me, what I am doing wrong.

       

      I even tried with grant_type=password and using a non-federated user having full access

       

      Client Id / Api Key                                      = <Client_id>

      Client Secret / Api Secret                          = <Client Secret>

      Authorization Request URL                       = <jive-url>/oauth2/authorize?Client_Id=<Client_id>

      Grant / Response Code Parameter           = password

      Access token request url                          = <jive-url>/oauth2/token

      Access token request url query string      = grant_type=password&username=<user>&password=<password>

       

      but it takes me to the login screen.

      Which method I should use, and do we need to login like a specific user to download the add-on.

       

      Gabe Beadel

       

       

       

       

       

       

       

       



         
       
       
       
       
       
       
       
       
       
       
       





        • Re: Not able to get token and refresh token

          Is this instance an on-prem/hosted instance?  If so, is it using a custom SSO plugin?  If so, is that plugin using a /** pattern and/or running for the /oauth* service paths? 

           

          The only thing that makes sense is if you answered yes to all of these questions.  If so, you need to make sure that your SSO filter doesn't run on /oauth* ... and you need to make sure that if you are relying on the browser to authorize that their is an active session in place for that flow so an identity can be paired to the token.  Otherwise, you will need to login to finalize the authorization.