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
  • Former Member
    0 Former Member

    You can't call or display widgets directly from an external application. You will need to build a similar UI that uses direct REST calls to get data from Community. This is actually what the Authentication training you linked is designed for - you make calls using the REST APIs and include the authentication details along with each request. 

  • Thanks   for your response.

    As you mentioned, we have built a similar UI and then calling RestApi (from external) for prefetching data on form. To access restApi, we are generating access-token (authentication details) "Using the Authorization Code Grant Type" for calling rest api with authentication from external application.

    In this process, we got the error in console while calling api.ashx/v2/oauth/authorize.

    Please help me to resolve this issue. Do let us know if you need any further information on this.

  • Former Member
    0 Former Member in reply to Anshuman Prusty

    Make sure you follow the full instructions on that page, including setting up an OAuth client under Administration > Integration > OAuth Clients. That is where you will get the client id and secret used for authentication/authorization process. Then, the process is a two step flow to first get an authorization code, then get an access_token. These are generated from Community, you don't generate your own codes.

Reply
  • Former Member
    0 Former Member in reply to Anshuman Prusty

    Make sure you follow the full instructions on that page, including setting up an OAuth client under Administration > Integration > OAuth Clients. That is where you will get the client id and secret used for authentication/authorization process. Then, the process is a two step flow to first get an authorization code, then get an access_token. These are generated from Community, you don't generate your own codes.

Children