i8beef / HomeAutio.Mqtt.GoogleHome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

algorithm' cannot be a 'null' or an empty object" error

sognen opened this issue · comments

Hi,

With the latest build I am getting an " 'algorithm' cannot be a 'null' or an empty object" error. See under for relevant log entries.
I do not see this with v 1.2.0.124.

br,
Cato

[14:18:12 INF] Loaded with configuration from: appsettings.json, /app/config/appsettings.Production.json
[14:18:13 FTL] IDX10000: The parameter 'algorithm' cannot be a 'null' or an empty object. (Parameter 'algorithm')
System.ArgumentNullException: IDX10000: The parameter 'algorithm' cannot be a 'null' or an empty object. (Parameter 'algorithm')
at Microsoft.IdentityModel.Tokens.SigningCredentials.set_Algorithm(String value)
at Microsoft.IdentityModel.Tokens.SigningCredentials..ctor(SecurityKey key, String algorithm)
at Microsoft.Extensions.DependencyInjection.IdentityServerBuilderExtensionsCrypto.AddSigningCredential(IIdentityServerBuilder builder, SecurityKey key, String signingAlgorithm)
at Microsoft.Extensions.DependencyInjection.IdentityServerBuilderExtensionsCrypto.AddDeveloperSigningCredential(IIdentityServerBuilder builder, Boolean persistKey, String filename, RsaSigningAlgorithm signingAlgorithm)
at HomeAutio.Mqtt.GoogleHome.Startup.ConfigureServices(IServiceCollection services) in /app/HomeAutio.Mqtt.GoogleHome/Startup.cs:line 253
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.g__Startup|0(IServiceCollection serviceCollection)
at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder1.<>c__DisplayClass15_0.<BuildStartupServicesFilterPipeline>g__RunPipeline|0(IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services) at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder1.<>c__DisplayClass14_0.g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.WebHost.Initialize()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at HomeAutio.Mqtt.GoogleHome.Program.Main(String[] args) in /app/HomeAutio.Mqtt.GoogleHome/Program.cs:line 45

I upgraded the IdentityServer libraries. In this version they changed how they serialize the tempkey when using the developer mode token generation, which is usually fine because you aren't supposed to use those beyond development. It also renames the tempkey.rsa file to tempkey.jwk, in a different format.

This means your old tempkey.rsa is invalid. You'll need to update to the version I just pushed (it fixes the filename change), delete your old tempkey.rsa, make sure that config/tempkey.jwk is persisted instead correctly (if you are mounting the entire config directory, you are fine already), and relink in Google Home.

But really, you should take this opportunity to move to your own signing certificates since you need to relink anyway.

Thanks, updated to the latest version and all is good.