Authorization Code Refresh

I only found a function of refreshing the token. I would wonder how can I create a function of generating a new authorization code and apply into the "authorizeCodeAuthorization" function. The static authorization code is always expired once I send the API request. Any idea for refreshing the authorization code ?

Hi,

By default, the SDK will refresh the access token using the refresh token when it expires.
For more see the README

Hi, Thankyou Ronan to reply this. My concern would be generating the authorizationCode parameter of the "authorizeCodeAuthorization" function. The authorizationCode shown in the image are always manually reproduce and paste to the variable. It always get statusCode:200 that every time i got the applied a new authorization code. otherwise, an empty/invalid authorizationCode will result a status code:400. Any suggestion for that? thankyou.

Hi,

This authorization code is generated by a Genesys Cloud server and sent to the application using a query parameter after a user authenticates with Genesys Cloud. There is no other way to generate the authorization code.
For more, see Grant - Authorization Code.
There is also a tutorial that demonstrates setting up a local server for completing this flow.

Hi, Ronan.
As you said Genesys Cloud server send to application by using a query parameter. Is that a way to retrieve the query parameter in Java sdk? Unfortunately, the tutorial link you provided does not include java language.

Hi,

I'm not aware of a Java tutorial for the Code Authorization flow. Handling the OAuth callback is outside of the scope of the SDK so it would need to be handled by your own implementation of the Code Authorization flow.

1 Like

Appreciate for your help. Thankyou dear Ronan.

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