question

Upvotes
Accepted
1 1 0 0

Login Denied:Failed to validate sso token

Hello, we found that there was disconnection when we used EMA to get dynamic data. The error report is as follows. What's the problem? thank you



һÔÂ 21, 2021 12:02:57 ÉÏÎç com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback

¾¯¸æ: loggerMsg

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received Channel warning event on channel Channel_1

Instance Name Consumer_1_2

RsslReactor @50e3bf38

RsslChannel @5af32797

Error Id 0

Internal sysError 0

Error Location Reactor.processWorkerEvent

Error text Failed REST request for the token service from HTTP status code 400 for user: xxxxx. Text: {"error":"invalid_grant"}

loggerMsgEnd




һÔÂ 20, 2021 11:04:30 ÏÂÎç com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback

¾¯¸æ: loggerMsg

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_1

RsslReactor @5ea7d158

RsslChannel @10f6165f

Error Id 0

Internal sysError 0

Error Location Reactor.processWorkerEvent

Error text Ping error for channel: Lost contact with connection...

loggerMsgEnd




һÔÂ 20, 2021 11:04:30 ÏÂÎç com.refinitiv.ema.access.LoginCallbackClient rdmLoginMsgCallback

¾¯¸æ: loggerMsg

ClientName: LoginCallbackClient

Severity: Warning

Text: RDMLogin stream state was changed to suspect with status message

username <not set>

usernameType <not set>


State: Open/Suspect/None - text: ""

loggerMsgEnd



2021-01-20 23:04:31,848 Timer-0 [monitorLogger(36)]-[INFO] | Monitor2021-01-20 23:04:31[]

һÔÂ 20, 2021 11:04:36 ÏÂÎç com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback

ÐÅϢ: loggerMsg

ClientName: ChannelCallbackClient

Severity: Info

Text: Received ChannelUp event on channel Channel_1

Instance Name Consumer_1_2

Component Version ads3.4.2.L1.linux.tis.rrg 64-bit

loggerMsgEnd



һÔÂ 20, 2021 11:04:36 ÏÂÎç com.refinitiv.ema.access.LoginCallbackClient rdmLoginMsgCallback

ÑÏÖØ: loggerMsg

ClientName: LoginCallbackClient

Severity: Error

Text: RDMLogin stream was closed with status message

username xxxxxxxxxxxxx

usernameType 1


State: Closed/Suspect/Internal error from sender - text: "Login Denied:Failed to validate sso token"

loggerMsgEnd

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @zzuwhj

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Hello @zzuwhj,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

-AHS

Upvotes
Accepted
24.6k 54 17 14

Hello @zzuwhj @Xiaorong.Xu

The "Error text Failed REST request for the token service from HTTP status code 400 for user: xxxxx. Text: {"error":"invalid_grant"} " error message indicates that the API cannot gets OAuth grant credentials from the RDP Auth service server.

How often the application occurs? Did the issue occur when the application tries to connect to the server for the "first time" or after it runs for a while?

I can't replicate the issue with the latest version of RTSDK 2.0/EMA Java 3.6.0 in my environment. I have run the ex450_MP_QueryServiceDiscovery example for a while and the API can run and get tokens successfully.

Could you please enable the API log to turn on the HTTP REST messages between the API and the server? You can enable it by setting the logging.properties file (the file is available at <RTSDK-2.0.0.L1 package>\Java\Ema\Core\src\main\resources folder) with the following pattern

.level=FINEST
 
handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler


java.util.logging.ConsoleHandler.level=FINEST
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
 
java.util.logging.FileHandler.level=FINEST
java.util.logging.FileHandler.pattern=<absolute path to your log file location>//ema.log
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s %2$s %n%5$s

Then run the application with the JVM argument -Djava.util.logging.config.file points to the logging.properties file

Example:

-Djava.util.logging.config.file=C:\drive_d\Project\APIs\EMA_Code\EMA_Java_200_Maven\src\main\resources\logging.properties

Please note that you can set the following properties on logging.properties file for the log file roll-over:

  • java.util.logging.FileHandler.limit=the maximum number of bytes to write to any one file
  • java.util.logging.FileHandler.count= the number of files to use
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.6k 54 17 14

Hello @zzuwhj

The "Error text Failed REST request for the token service from HTTP status code 400 for user: xxxxx. Text: {"error":"invalid_grant"} " error message seems to relate to the API couldn't get the Authentication. I am assuming that you are connecting to the Refinitiv Real-Time Optimized (ERT in Cloud) connection?

  • Could you please let me known the EMA/RTSDK version and edition (Java or C++)?
  • Can you replicate the issue with EMA ex450_MP_QueryServiceDiscovery example?
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

yes,We use the connecting to the Refinitiv Real-Time Optimized (ERT in Cloud) connection


  •     
                         
    1. The development language is Java 
  •     
                         
    1. EMA/RTSDK version  is <refinitiv.version>3.6.0.0</refinitiv.version>


@wasin.waeosri Thank you for your answer. Next, what aspects of analysis and troubleshooting do we need

Hi Wasin

Thank you for your help. After discussing with client, I would confirm the error message popped out when client api is ready for receiving dynamic messages, e.g. updates. The method was consumer.registerClient(EmaFactory.createReqMsg().serviceName("ELEKTRON_DD").payload(elementList), dynamicDataCallback);

With regard to replicating with EMA ex450_MP_QueryServiceDiscovery. I am working with client.

In the meantime could you please advise the cause and how to avoid it? Thank you.

Upvotes
1 1 0 0

yes,We use the connecting to the Refinitiv Real-Time Optimized (ERT in Cloud) connection


  • The development language is Java 
  • EMA/RTSDK version  is   <refinitiv.version>3.6.0.0</refinitiv.version>


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 0 0

@wasin.waeosri

Thank you for your reply

The issue occur when the application tries to connect to the server after it runs for a while.

we use the ex450_MP_QueryServiceDiscovery example:


ElementList batch = EmaFactory.createElementList();

        OmmArray array = EmaFactory.createOmmArray();

//        subscribe all

        int num = stocksSize;

        Iterator<String> codeIterator = USDataCenter.getInstance().getRicCodes();

        while (codeIterator.hasNext()) {

            try {

                array.add(EmaFactory.createOmmArrayEntry().ascii(codeIterator.next()));

                num--;

                if (num % 1000 == 0) {

                    batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array));

                    cloudClient.getDyncStock(batch);

                    array.clear();

                    batch.clear();

                }

            } catch (Exception e) {

            }

        }

we enable the API log but can't find log file。


  • you can't replicate the issue with the latest version of RTSDK 2.0/EMA Java 3.6.0 in my environment. Are you subscribing to one stock or to all paged stocks?
  • I wonder if every subscription will be authenticated?
  • We are binding in /etc/hosts api.refinitiv.com 75.2.0.254 99.83.242.11, is that a problem?
  • Is disconnection related to the number of times we subscribe or the network?
  • Will disconnection of subscription reconnect?


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.6k 54 17 14

Hello @zzuwhj

Could you please share your logging.properties file and your -Djava.util.logging.config.file command?

The authentication to api.refinitiv.com (for RDP Auth service) is for the Login stream only, not item streams. Basically, the authentication flow is the following:

  1. The application/API sends Token service request message with Machine ID, Password, and Client Id (aka App Key) to the RDP Auth service
  2. RDP Auth service returns Access Token, Refresh Token, and Expire information (5 minutes) to the application
  3. The API then connects to the Refinitiv Real-Time Optimized server on AWS with Access Token in the OMM Login request message.
  4. The Access Token always expires every 5 minutes
  5. So before Access Token expires, the API sends the Refresh Token to the RDP Auth service to get a new Access Token
  6. Once the API receives the new Access Token, the API re-send OMM Login request message to the Refinitiv Real-Time Optimized server to extend the connection.
  7. Looping steps (4) to (6)

The API REST log file will let us check whether the "error":"invalid_grant" error message is returned from which Token request message.

Additonally, you may contact The Refinitiv Real-Time Optimized team to verify this RDP response error message via my.refinitiv.com website. Please choose "Refinitiv Real-Time - Optimize" Product and you may need to provide your Machine ID detail.



ahs-myrefinitiv.png (17.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dear Waeosri, thank you for your help. Could you please specify how client can find or generate the files you asked earlier?

  • logging.properties file
  • -Djava.util.logging.config.file command?
  • API REST log file

Thank you

Hello @Xiaorong.Xu

The client can find the example logging.properties file from the following locations:

Please note that the logging.properties is the Java Logging API configuration file. The client can find more detail about the configuration file from Oracle or any Java resources.

Upvotes
1 1 0 0

thx

We want to know more

Are we using a consumer client to subscribe to multiple US stock markets at the same time?

Or can multiple consumerclients be used for subscription?

thank you!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @zzuwhj

Sorry for the late reply. Yes, you can use a single consumer client to consume multiple items from various markets. You can use the API Batch feature to send multiple items in a single request message, please see more detail on the EMA Java Example ex370_MP_Batch in the SDK package.

Please note that the Machine-ID supports 5 concurrent connections.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.