AECX / FinTube

Jellyfin Plugin to import directly from YT
65 stars 9 forks source link

The AuthorizationPolicy named: 'DefaultAuthorization' was not found. #10

Open pgrobelniak opened 1 month ago

pgrobelniak commented 1 month ago

Using Jellyfin version 10.9.2. Cannot select target library. Clicking submit does nothing. There is error message in log:

[2024-05-23 09:40:06.011 +00:00] [ERR] Error processing request. URL "GET" "/fintube/libraries".
System.InvalidOperationException: The AuthorizationPolicy named: 'DefaultAuthorization' was not found.
   at Microsoft.AspNetCore.Authorization.AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider policyProvider, IEnumerable`1 authorizeData, IEnumerable`1 policies)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
AECX commented 1 month ago

Hey, thank you for reporting this issue. I think this issue is from https://github.com/AECX/FinTube/commit/268552087ecc06b1a0a3e821a6d28312c93cf846 - @vincentroyc do you have any idea? I'm personally seeing the same issue in my installation

tomi-v commented 4 weeks ago

The same thing is happening for me as well, on Jellyfin 10.9.5 (released yesterday). Maybe it has something to do with this issue? It wasn't happening in this plugin, but the error message is the exact same... :thinking:

algorizan commented 2 weeks ago

I'm also getting this problem. But I've also noticed that the version of FinTube that it says it's installed on Jellyfin is 1.0.0.0 despite trying to install 1.0.1.0. When I try to install 1.0.0.0 from the version dropdown it says it's already installed, and if I try to install 1.0.1.0 it acts like it's installing it but the version will stay as 1.0.0.0. I don't know if this means that the wrong version is actually installed or if it's just labelled incorrectly and I do have 1.0.1.0 installed.

I also use the Trakt and Opensubtitles plugins that use auth keys and I don't have any issues with those.

oatmealm commented 2 weeks ago

Same for me on 10.9.5.... is there a settings file to manually set destination library?

lamebread commented 2 weeks ago

Freshly installed FinTube for the first time, get the same error. Jellyfin 10.9.6, FinTube 1.0.0.0 according to the plugin page.

bgstack15 commented 2 weeks ago

Seems like you could try changing to one of the options from https://github.com/jellyfin/jellyfin/blob/v10.9.0/MediaBrowser.Common/Api/Policies.cs. An example is shown in a random other plugin: https://github.com/9p4/jellyfin-plugin-sso/blob/b8e56cefab12b2ad614d5a7b589e7de7b575d76b/SSO-Auth/Api/SSOController.cs#L331 Specifically, file Jellyfin.Plugin.FinTube/Api/FinTubeActivityController.cs#L20 could be:

[Authorize(Policy = "CollectionManagement")]

EDIT: I have not tested this.

vincentroyc commented 1 week ago

@AECX PR is up : https://github.com/AECX/FinTube/pull/13

In the mean time, my repo can be used for the fix, but be advised that it's a dev repo and I didn't quite understand how to manage the fork sync and the releases so my releases are de synched but this one is working : https://raw.githubusercontent.com/vincentroyc/FinTube/master/manifest.json