Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
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
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.
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
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.
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