Comments (5)
@aspik Could you please provide the steps on how to reproduce this error? And a stack trace would be nice.
from trakt.net.
Sure:
- start the client,
- authorize with pin:
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Models/TraktSetupModel.cs#L120 - save the response to file:
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Models/TraktSetupModel.cs#L269-L274 - close the client,
- start the client,
- refresh the authorization by exchanging the refresh token:
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/LibrarySynchronization.cs#L447-L464
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/TraktClientProxy.cs#L58
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:
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/TraktClientProxy.cs#L281-L294
from trakt.net.
@aspik I think, you didn't set the saved authorization in the client.
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/LibrarySynchronization.cs#L460
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
from trakt.net.
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.
I just restored back the old check in the new version, compiled it and exchanged in my plugin. Now is all working as before :)
from trakt.net.
Ah, okay. You're right, that should also work with just the refresh token.
from trakt.net.
Related Issues (20)
- Update properties in `ITraktSyncLastActivities`
- Rename method `GetCollectionMoviesAsync` to `GetMovieCollectionAsync` in Module `TraktSyncModule`
- Rename method `GetCollectionShowsAsync` to `GetShowCollectionAsync` in Module `TraktSyncModule`
- Rename method `ReorderRecommendedItemsAsync` to `ReorderPersonalRecommendedItemsAsync` in Module `TraktSyncModule`
- Move multiple query parameters into namespace `TraktNet.Parameters`
- Rename method `GetCollectionMoviesAsync` to `GetMovieCollectionAsync` in Module `TraktUsersModule`
- Rename method `GetCollectionShowsAsync` to `GetShowCollectionAsync` in Module `TraktUsersModule`
- Add support for "sort_by" and "sort_how" parameters in `TraktUsersModule.CreatePersonalListAsync()`
- Add support for "sort_by" and "sort_how" parameters in `TraktUsersModule.UpdatePersonalListAsync()`
- Use `ITraktUserPersonalListItemsRemovePost` instead of `ITraktUserPersonalListItemsPost` in `TraktUsersModule.RemovePersonalListItemsAsync()`
- Use `ITraktSyncCollectionRemovePost` instead of `ITraktSyncCollectionPost` in `TraktSyncModule.RemoveCollectionItemsAsync()`
- Use `ITraktSyncRatingsRemovePost` instead of `ITraktSyncRatingsPost` in `TraktSyncModule.RemoveRatingsAsync()`
- Use `ITraktSyncRecommendationsRemovePost` instead of `ITraktSyncRecommendationsPost` in `TraktSyncModule.RemovePersonalRecommendationsAsync()`
- Use `ITraktSyncWatchlistRemovePost` instead of `ITraktSyncWatchlistPost` in `TraktSyncModule.RemoveWatchlistItemsAsync()`
- Use `ITraktUserHiddenItemsRemovePost` instead of `ITraktUserHiddenItemsPost` in `TraktUsersModule.RemoveHiddenItemsAsync()`
- Rename `TraktAuthenticationModule` to `TraktAuthModule`
- Add possibility to serialize objects as JSON with indentation
- Fix missing PDB file in NuGet package
- Remove `TraktLanguageService`
- Add method overloads in modules for methods with optional parameters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trakt.net.