How Java application to retrieve user context access token

Hi Team,

Now I'm developing a Maven Java application that is able to let agents to subscript on "v2.users.{id}.conversations" topic. So I tried to use Grant - Authorization Code method to retrieve user context access token.

But now I encounter 2 problems:

  1. How to provide agents a login page in my Java desktop program?
  2. Grant - Authorization Code require a callback URL, but that is doesn't existing in my Java desktop program?

Based on my study on the Java SDK which is provided by Genesys, I found these is no way to get the Authorization code. So that is possible to to retrieve user context access token in my Java application?

Thanks & Best Regards

Hi,

Please see the documentation for Authorization Code Grant. This explains how the authorization code grant process works and also take a look at the Java SDK documentation for Authenticating with Authorization Code.

Thanks,

Mike

Hi Michael,

The example in the page you mentioned is assume I already has authorization code to proceed to obtain the access token. But actually I haven't authorization code and I'm suffering how to obtain it if my Java application without html page? Could you give me a hint regarding this?

Thank You very much.

The documentation assumes you already have the auth code from having the user complete the Authorization Code Grant. The Java SDK is a headless SDK, meaning that it does not come packaged with a web browser to interface with the user to complete an OAuth flow. Your application will need to use whatever means available to it given your specific application environment and UI frameworks to provide a browser interface to the user. The user will complete the OAuth flow in your browser, the app will retrieve the auth code from the URL at the end of the flow, then use in the SDK to obtain an access token as shown in your screenshot above.

Hi Tim,

Thank your explanation. Now I understand I must provide a browser UI for user to complete the OAuth flow.

Thank you very much.

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