RTO Java example

Options
dumitru.arama
edited July 16 in WebSocket API

Hello,

Our client is currently migrating to v2 authentication and is in process of testing the following RTO Java sample code:

websocket-api/Applications/Examples/RTO/java/MarketPriceRTOClientCredAuth.java at master · Refinitiv/websocket-api · GitHub

They are concerned that the MarketPriceRTOClientCredAuth.java posted on the website link above is incorrect specifically with the way it periodically re-authenticates.

They do not see a grant_type of refresh_token, and furthermore, the newly returned access_token from the HTTP authentication request is not being passed back into the web socket.

Can you please help?
Thank you

Answers

  • Hello @dumitru.arama

    I checked the Java RTO example and did not find any discrepancies. There is no concept of periodic access token refresh when using Client Credentials, but if there is a connection loss, a valid token is required. This means the app has to re-authenticate if the token is expired. This is what is implemented in the code sample.

    They do not see a grant_type of refresh_token, and furthermore, the newly returned access_token from the HTTP authentication request is not being passed back into the web socket.

    There is no Refresh token when using client credentials.

    PS: There is an option to use RTSDK Java, which can handle all the discovery and session management tasks for the user. See this example on GitHub.

  • wasin.w
    wasin.w admin
    edited July 16

    Hello @dumitru.arama

    Please check an Getting Started with Version 2 Authentication for The Real-Time Optimized: Overview article for an in dept detail of the Version 2 authentication.

    The Version 2 does not use a refresh token anymore; it uses the same Client Credential grant request message for both the initial request and renewal of the access token.

    There is also a Real-Time WebSocket API: The Real-Time Optimized Version 2 Authentication Migration Guide article that might help you.

  • Thank you, Gurpreet and Wasin - appreciate your help!