-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refreshing authorization not working with expired or invalid access token #36
Comments
@aspik Could you please provide the steps on how to reproduce this error? And a stack trace would be nice. |
Sure:
Result: exception with message: "not authorized" is thrown. I'm afraid that the stack trace will not be helpful. I'm using a wrapper around the TraktClient (for unit tests purpose ), and I can catch only the AggregateException: |
@aspik I think, you didn't set the saved authorization in the client. There might be missing this: _traktClient.Authorization = savedAuth; See the example "Serialize and deserialize authorization information" at https://github.com/henrikfroehling/Trakt.NET#basic-usage |
This was not needed with the old lib. And tbh I'm not sure why I have to do it? :) its only the refreshtoken which matters. |
Ah, okay. You're right, that should also work with just the refresh token. |
It is not possible to refresh the authorization, if the client is "restarted".
old implementation:
https://github.com/henrikfroehling/TraktApiSharp/blob/master/Source/Lib/TraktApiSharp/Authentication/TraktAuthentication.cs#L376
new implementation:
Trakt.NET/Source/Lib/Trakt.NET/Requests/Handler/AuthenticationRequestHandler.cs
Line 254 in 958b1c4
In the new version there is only a check, if the authentication is authorized. During a refresh the authentication is always not authorized, therefore it is not possible to do a refresh. Please bring back the old check :)
The text was updated successfully, but these errors were encountered: