Error: Generating Access Token while calling API from External Application

We have created Widget (Using Velocity) which is dynamically fetching group, forum, tags based on user selection. The widget is working fine within community.

Our requirement is to call this widget from external application.

To implement this we are generating access token using the instruction (Using the Authorization Code Grant Type) provided at the below link (community.telligent.com/.../authentication

We are getting the below error.

'community-qa.thomsonreuters.com/.../authorize from origin 'community-dev.thomsonreuters.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request."

Any help will be appreciated.

Parents
No Data
Reply
  • Taking the CORs issue aside, which is really something that is beyond the scope of community support, especially from a third party application, if you are doing any of this via javascript on that site I would re-evaluate doing it this way all together.

    When you do this in javascript on the client, you are exposing your client secret to ANYONE who can view the source of the page, which means any user can take that secret and access the API and depending on how you have your client configured, possibly with administrative rights.

    It is more appropriate to proxy all REST requests server side, meaning you expose an HTTP endpoint to your app, then the app makes the REST request on the server.  This not only makes sure your secret is not compromised, but also completely eliminates your CORS issues.

Children
No Data