Skip to content
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

"Error Processing Request" before attempting login, with "Value cannot be null" in the logs #82

Closed
alexander-bauer opened this issue Sep 22, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@alexander-bauer
Copy link

alexander-bauer commented Sep 22, 2022

Describe the bug
Attempting to log in with SSO causes an opaque error that I am unsure how to troubleshoot further.

To Reproduce
Steps to reproduce the behavior:

After configuring SSO from the admin panel, I opened another window to attempt to log in with a user (that is not yet created in Jellyfin), at https://jellyfin.<mydomain>/sso/OID/r/keycloak.

Expected behavior
Redirect to Keycloak, log in, redirect back to Jellyfin WebUI.

Configuration

{
  "keycloak": {
    "OidEndpoint": "https://keycloak.<domain>/realms/<realm>",
    "OidClientId": "jellyfin",
    "OidSecret": "<redacted>",
    "Enabled": true,
    "EnableAuthorization": true,
    "EnableAllFolders": true,
    "EnabledFolders": [],
    "AdminRoles": [
      "jellyfin-admin"
    ],
    "Roles": [
      "jellyfin-user"
    ],
    "EnableFolderRoles": false,
    "FolderRoleMapping": [],
    "RoleClaim": "resource_access.jellyfin.roles",
    "OidScopes": [
      "roles"
    ],
    "DefaultProvider": "Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider",
    "CanonicalLinks": {}
  }
}

Versions (please complete the following information):

  • OS: Kubernetes on K3OS
  • Browser: Firefox
  • Jellyfin Version: 10.8.4
  • Plugin Version: 3.4.0.0

Logs

This the message I see in the Jellyfin pod logs.

[23:26:15] [INF] [8] Jellyfin.Plugin.SSO_Auth.Api.SSOController: SSO Controller initialized
[23:26:15] [ERR] [8] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL GET /sso/OID/r/keycloak.
System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Jellyfin.Plugin.SSO_Auth.Api.SSOController.OidPost(String provider, String state)
   at lambda_method586(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.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.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
@alexander-bauer alexander-bauer added the bug Something isn't working label Sep 22, 2022
@alexander-bauer
Copy link
Author

Oops. I was navigating to /sso/OID/r/keycloak, but I should've been going to /sso/OID/p/keycloak. The r is, I would guess, for "response".

I hope this issue helps others spot the same mistake.

@9p4
Copy link
Owner

9p4 commented Sep 23, 2022

See #49

Since it seems systemic, I might change it so it's not a one-character path (and allow for the old paths to still work).

@9p4
Copy link
Owner

9p4 commented Sep 23, 2022

Closing in favour of #84

@9p4 9p4 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants