RefreshTokenDelegatingHandler without inner handler #266
Replies: 2 comments
-
|
Can you share more details? |
Beta Was this translation helpful? Give feedback.
-
|
I'm still struggling with the basics and my testing environment. Thanks for asking. What I think I want to receive: I'm using the RestSharp.RestClient to perform queries to a service, once I'm done authenticating. At one point, I guess, the access token will expire and prevent me from executing further queries. Now I want to more or transparently renew the access token without the caller of the RestClient recognizing it. From what I assumed from the topic mentioned above, that code will trigger the TokenRefreshed event, once the token expires. But looking at the name of the TokenRefreshed event now, that will probably only happen AFTER the token was refreshed, so this will probably get me nowhere. Anyways, I managed to fix the null pointer exception, by adding the following clause, but I'm still in the process of finding out, what this exactly does. Probably it won't solve my task. In the end, I guess, I will just evaluate the return code and wait for unauthorized, in which case, I perform a token renew and try again. Except there is some code in place somewhere, that does that already. Update: I managed to test it and it looks like the token expires, the event gets fired some 15 times and then a new token is present with the next request. I guess, I'm good then. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to implement the code from this thread, but I keep receiving the exception, that the InnerHandler wasn't assigned:
Beta Was this translation helpful? Give feedback.
All reactions