question

Upvotes
Accepted
26 1 3 11

Error in Using custom addresses for tokenServiceUrlV1 and tokenServiceUrlV2

Hi,

I used custom addresses for tokenServiceUrlV1 and tokenServiceUrlV2. I get following error. Can i know exactly what this error means ? Wrong credentials ?


loggerMsg
TimeStamp: 08:46:48.544
ClientName: ChannelCallbackClient
Severity: Error
Text: Failed to add RsslChannel(s) to RsslReactor. Channel name(s) Channel_1Channel_1Channel_2
Instance Name Consumer_1_10
RsslReactor 0x0x7f498396fbf0
RsslChannel 0
Error Id -1
Internal sysError 0
Error Location /home/ec2-user/Real-Time-SDK/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:11899
Error Text Failed to request authentication token information with HTTP error 400. Text: {"error":{"id":"bbdc829e-9e1a-4382-9e02-ea1872e65329","code":"400","message":"Valida
tion error","status":"Bad Request","errors":[{"key":"requestBody","reason":"Error at \"/grant_type\": value is not one of the allowed values [\"client_credentials\"]"}]}}
loggerMsgEnd

ema-api#technologyc++
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
Accepted
76.9k 240 52 72

@thilinaillangasinghe

Thanks for reaching out to us.

You may use the incorrect endpoint. There are two versions of the authentication endpoints.

The authentication version 1 uses a machine Account (username, password, and App-Key) and supports password and refresh grant types. The authentication version 2 uses a service account (Client ID and Client Secret) and supports the client credentials grant type.

According to the error, I assume that you have a machine account for version 1 but you connect to the authentication version 2 endpoint.

Please check your credential if it is a machine account or a service account. If it is a machine account, use the authentication version 1 endpoint (tokenServiceUrlV1). If it is a service account, use the authentication version 2 endpoint (tokenServiceUrlV2).

For more information, please refer to the Getting Started with Version 2 Authentication for Refinitiv Real-Time: Overview article.

I hope that this information is of help.

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
24k 52 17 14

Hello @thilinaillangasinghe

I am sorry to hear that you are facing the issue. To let me understand the problem better, please give me the following information.

  • a version of EMA C++
  • OS, platform information
  • Which type of RTO credentials? Is it a Machine ID (GE-A-XXXXXXX-X-XXXX) or Service Account ID (GE-XXXXXXX)
  • The snippet code that set the custom URL, set credentials (config.consumerName(...) and serviceDiscovery.registerClient(...))

I recommend you try the Cons450 example and see if the problem still persists.

If you are using a Machine ID account, the code needs to set RTO credentials with username (Machine ID), password, and App Key (aka client_id_v1):

serviceDiscovery.registerClient( ServiceEndpointDiscoveryOption().username( userName ).password( password )
    .clientId( clientId ).transport( transportProtocol ).takeExclusiveSignOnControl( takeExclusiveSignOnControl ), client );
    
config.consumerName( "Consumer_1" ).username( userName ).password( password )
    .clientId( clientId ).config( configDb ).takeExclusiveSignOnControl( takeExclusiveSignOnControl );

If you are using the Service Account ID, the code needs to set RTO credentials with client id and client secret:

serviceDiscovery.registerClient( ServiceEndpointDiscoveryOption().clientId( clientId ).clientSecret( clientSecret )
    .transport( transportProtocol ), client );
    
config.consumerName( "Consumer_1" ).clientId( clientId ).clientSecret( clientSecret )
    .config( configDb );
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
26 1 3 11

Thanks all. @Jirapongse 's response helped in my case.

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.

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.