OAuth client id cannot authenticate and redirecturiBase is invalid

Executing sample app in Genesys Appfoundry will recieve an error page. - "Sorry, PureCloud cannot authenticate you at this time."

My goal is simple and should be a very minimum modification as possible to sample app and be able execute in our staging server.

The following are steps and changes I've done for sample app.

  1. Build and deploy premium client sample app in staging
  2. Login to MypureCloud AU dashbord and install AppFoundry premium client app
  3. Change the Application URL to our staging site.
  4. Generate a new OAuth client from MypureCloud.
  5. Modify the config.js file to change the AU regional settings and set the "CLIENT_ID" in step #4.
  6. Redeployed premium client sample app in staging
  7. Login to MyPureCloud AU dashboard and run sample app.

Also, does the ClientID defined in MyPC dashboard has to be approved first before I can use it?

Let me know your thoughts if doing it right or something I've missed from above steps?

Thanks,
Sean

What process does your app go through that results in that error?

hi tim,

Nothing unusual just got the premium sample app here : https://github.com/MyPureCloud/purecloud-premium app. And then performed the above steps because my intention is to build our app over time on top of this code base once setup properly in our staging server(redirectUriBase). At the momement, I encounter error message "Sorry, PureCloud cannot authenticate you at this time" when I always launch the app inside MyPC.

Chrome dev tool has the following logs upon debugging.

The error "We did not recognize your redirect url" means that the URL sent by the application when it initiates the login does not match the redirect URLs configured for the OAuth client that was used. They must match exactly, character for character. Check to see what the app is sending and what your OAuth client is configured for and update one or the other so they match.

Hi Tim,

I'm working with the develop on this one. I can confirm that his authorized redirect URI's match in config.js and in the oauth configuration. I have a few questions:

  1. What is the correct Grant Type? We have tried Token Implicit Grant (Browser) and Code Authorization.
  2. In config.js the appName is supposed to "match the integration type name of the Premium App". Where do I find the integration type name?
  3. If there is more than one oauth configuration how purecloud know which one to use?

Lastly, in this case the developer has installed the example Integration via purecloud and then edited it to match his code. Is this recommended? If not how do we install a new integration from scratch to develop against?

Thanks,

Anthony

The example app initiates an implicit grant flow.

@anon28885283 can you answer?

When the authorization process is initiated, a client ID is sent with the request. That is the client ID that PureCloud will use when authorizing the user.

If you're developing your own app (or customizing the example), add it as a custom client app: https://help.mypurecloud.com/articles/about-custom-client-application-integrations/

Hi Anthony,

Once your premium app is available on the AppFoundry-PureCloud and can be deployed to different orgs it will have its own unique id. This is used mainly for checking if the current org has the premium app available or not so it can display optional messages. You can get the different types available to your org by running (/api/v2/integrations/types). For testing purposes, the default value should be fine or if you don't have the Premium App Sample available in your test org, you can temporarily set any of the default ones' id (eg 'embedded-client-app') so it will pass the check.

That shouldn't be the cause of your current issue though. I'm thinking it might still be using the wrong client id. Could you add this query parameter to your initial endpoint to force the environment.
?environment=mypurecloud.com.au

Ex:
https://webappendpoint.com/page.html?environment=mypurecloud.com.au

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