ThomsonReuters.Dss.Api.UnauthorizedException
I'm using the DataScope REST API toolkit for C#. On occasion when I run my application I get the following exception: ThomsonReuters.Dss.Api.UnauthorizedException: Authentication request failed because no token was provided in the Authorization: header.
When I rerun the application everything works as expected. Any ideas?
The latest toolkit, 12.3.361
The code is simplistic, it's straight out of the SDK tutorial.
_extractionsContext = new ExtractionsContext(new Uri(dssURI), dssUserName, dssUserPassword);
//create and populate the request
var result = _extractionsContext.ExtractWithNotes(request);
Best Answer
-
What seems to have solved the issue is accessing the SessionToken and simply logging in, just like the DSS .NET API Samples. I can't begin to explain why this does the trick however.
_extractionsContext.SessionToken
0
Answers
-
Ian, based on the SDK tutorial, I instantiate an ExtractionsContext with the URI/login/password. Then I call ExtractWithNotes. I don't see RequestToken as a method available on the ExtractionContext.
0 -
Hi @AlexL,
Could you share your application code and version of the SDK?
0 -
Could it be a race around condition - where the second request for ExtractWithNotes might be sent out, before the first call for RequestToken has returned or has failed.
If this is happening regularly, you can post a code snippet so that we can replicate the issue. Other option is to setup a proxy server to catch and inspect the raw request/response messages.
0 -
The latest toolkit, 12.3.361
The code is simplistic, it's straight out of the SDK tutorial.
_extractionsContext = new ExtractionsContext(new Uri(dssURI), dssUserName, dssUserPassword);
//create and populate the request
var result = _extractionsContext.ExtractWithNotes(request);0 -
Gurpreet, please see the amended post with the code snippet. There is one call to ExtractWithNotes.
0 -
The DSS .NET sample application has an example of ExtractWithNotes implementation in the Quick Start section. Do you observe this issue with the sample application as well?
0 -
I don't really run the sample app daily so I don't know.
0 -
@AlexL, I have a feeling Gurpreet might be on to something here, maybe there is a race condition, because the request is sent out immediately after the ExtractionContext instantiation. Could you try adding a small wait (I'd go for 1 to 5 seconds, as a test) just after the ExtractionContext instantiation?
0 -
what Gurpreet is suggesting is to run different code, to see if it fails similarly.
Actually I'd recommend you try running one of the C# example codes (available under the downloads tab under ".Net SDK Tutorials code") several times in a row, and tell us if that also fails (it should not).
I recommend that instead of the C# example app described under the Quick Start tab because the C# example app requires a lot of manual actions, which will take more time, and will probably alleviate an eventual race condition.
0 -
@AlexL, what you do is correct. Instantiating the ExtractionContext is what logs you in. The token is managed transparently in the background for you, by the SDK, there is no need for you to manage the token.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 690 Datastream
- 1.5K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 560 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 280 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 721 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛