4 Replies Latest reply on Jul 3, 2017 10:19 AM by sloison RSS
    sloison Newbie

    OAuth2 authorization code

    Hi All,

     

    I have to consume an external API which implement OAuth2.0 autorization code flow to grant consent and access data.

    Do you know how to do that ?

    Do you know where I can found documentation ?

     

    Best regards

      • Re: OAuth2 authorization code
        wposner-2 Apprentice

        Check out the new TWX 8 SSO functionality using PingFederate. You can get more info in the TWX help and TWX 8 Technical training content.

          • Re: OAuth2 authorization code
            sloison Newbie

            Hi,

             

            Thanks for information.

            If I well understand this is a new fonctionality provided in TWX 8 in order to do SSO through OAuth2 and PingFederate.

            Actually my need is just to use the OAuth2 protocol (authorization code flow) in order to access an external API (for data exchange)

            Do you know if some piece of code is reusable from the PingFederate integration (the part which concern OAuth2) ?

            Do you know if TWX7 is able to do the same ?

             

            Best Regards

            Stéphane

              • Re: OAuth2 authorization code
                wposner-2 Apprentice

                Ok...So if that's the case, you should be able to do everything you need just using services and REST calls.   When I was first learning TWX, I wrote a series of services that allowed me to connect to my Ecobee thermostats.  I did this creating a thing with a service that obtained the OAuth2 token by building up the REST request and submitting it to their API.  Once I had the token, I stored it as a property on the thing and then used that token to continue to make API calls.  I don't have that code anymore or I'd happily share it, but creating the REST request to obtain the token is the first step.  Then you'll just have to pass the token in the header of all the API calls for whatever system you're trying to access.

                  • Re: OAuth2 authorization code
                    sloison Newbie

                    Hi Wayne,

                    That's the case, the point where I'm confusing is that in a "authorization code" OAuth2 flow it is not only api call. There is also HTTP redirect and HTML inclusion to manage the consent part of the flow (the part where the User give to the Authorization Server 1/ his credentials login/password, 2/ the consent to share theire data, like in Google+ or Facebook connect). I have don't know if TWX is able to do that.

                     

                    Best Regards

                    Stéphane