Grant - Authorization Code...errorKey=tooManyRedirects

Hi,
I am trying to test the Grant - Authorization Code with the example in NodeJs. But the answer is errorKey = tooManyRedirects

If someone can help me ..

Regards

Hello,

As I am not sure what you are starting from (if you have a my_info.html or not, if you modified the server.js or if you create the OAuth client), here are the steps.

  1. You need to Create an OAuth Client with "Code Authorization" Grant type, and setting http://localhost:8085/oauth2/callback as an Authorized redirect URI. Make a copy of the Client ID and Client Secret of that OAuth client.

  2. You need 3 files in this sample. The server.js (the nodejs script - which will run a webserver on http port 8085 - using express npm). The my_info.html (the page you will try to display). And the package.json (that lists the modules/libraries used in this server.js sample)
    You can find them here: https://github.com/MyPureCloud/developercenter-tutorials/tree/master/oauth-auth-code/nodejs
    Note: you will need to add an entry to the package.json which seems to be missing. Add "node-fetch" in the dependencies (value "*" like the others).

  3. Set your nodejs environment variables for GENESYS_CLOUD_CLIENT_ID, GENESYS_CLOUD_CLIENT_SECRET (values from your OAuth Client ID and Client Secret) and GENESYS_CLOUD_ENVIRONMENT (apparently 'mypurecloud.ie' in your case) or you can assign them directly in the server.js.

  4. Install and run:
    npm install
    npm start

  5. Open a web page at http://localhost:8085/my_info.html

That should work (I just tried it myself).

Regards,

thanks, it works for me. I have recreated the one OAuth Client with Code Authorization with all scopes.

regards

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.