I use .Net Core 2.0 and ServiceStack.Core 1.044
I set the ExpireRefreshToken to 45 seconds and the ExpireToken to 10 seconds.
After sending the Authenticate request, I get the BearerToken and RefreshToken within the response object.
Also the properties bearerToken and refreshToken of the JsonServiceClient instance are correctly populated.
I created a protected Message using the Authenticate and RequiredRole Attributes. I am only able to call that method after the client is authenticated, so it looks like everything is setup correctly.
My issue is the “onAuthenticationRequired” callback of the JsonServiceClient.
I expected that after the BearerToken got expired (10 seconds), the client would try to request a new BearerToken by using the RefreshToken which is in my tests still valid.
I can’t find any documentation about how a JsonServiceClient can request a new BearerToken by using a RefreshToken.
My questions are:
a) since the client has the bearerToken and refreshToken after the Authenticate request, why is it not using the refreshToken after the bearerToken expires?
I expected that the client tries to get new bearerToken until the refreshToken gets expired and only than call the onAuthenticationRequired callback.
b) What is the url/request object to issue a new bearerToken by using a refreshToken?
Thank for your reponse!
I was able to fix the issue by explicit assigning the bearerToken and refreshToken to the JsonServiceClient instance. Now the bearerToken gets refreshed as expected
I’ve resolved an issue which prevents the recursion and throws an ErrorResponse with a type of RefreshTokenException when there’s an invalid or expired RefreshToken in this commit, which you can handle with: