ABP Framework version: v9.0.2
UI Type: MVC
Database System: EF Core (SQL Server)
Tiered (for MVC) or Auth Server Separated: yes
Exception message and full stack trace:
Steps to reproduce the issue:
I am facing issue when deploying app to azure app service, it is not finding the openiddict.pfx file.
Application '/LM/W3SVC/583530665/ROOT' with physical root 'C:\home\site\wwwroot' has exited from Program.Main with exit code = '1'. First 30KB characters of captured stdout and stderr logs:
[20:18:34 INF] Starting web host.
[20:18:42 FTL] Host terminated unexpectedly!
Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule, Volo.Abp.OpenIddict.AspNetCore, Version=9.0.2.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
---> System.Security.Cryptography.CryptographicException: The system cannot find the file specified.
at System.Security.Cryptography.X509Certificates.X509CertificateLoader.ImportPfx(ReadOnlySpan1 data, ReadOnlySpan
1 password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadPkcs12NoLimits(ReadOnlyMemory1 data, ReadOnlySpan
1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12Return& earlyReturn)
at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadPkcs12(ReadOnlyMemory1 data, ReadOnlySpan
1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12LoaderLimits loaderLimits)
at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadFromFile[T](String path, ReadOnlySpan1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12LoaderLimits loaderLimits, LoadFromFileFunc
1 loader)
at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadPkcs12PalFromFile(String path, ReadOnlySpan1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12LoaderLimits loaderLimits) at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlobOrFile(ReadOnlySpan
1 rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
at Microsoft.Extensions.DependencyInjection.OpenIddictServerBuilderExtensions.AddProductionEncryptionAndSigningCertificate(OpenIddictServerBuilder builder, String fileName, String passPhrase, Nullable1 flag) at NextGen.Portal.Web.PortalWebModule.<>c__DisplayClass0_0.<PreConfigureServices>b__3(OpenIddictServerBuilder serverBuilder) in C:\Projects\NextGen\NextGenPortal\src\NextGen.Portal.Web\PortalWebModule.cs:line 151 at Volo.Abp.Options.PreConfigureActionList
1.Configure(TOptions options)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionPreConfigureExtensions.ExecutePreConfiguredActions[TOptions](IServiceCollection services, TOptions options)
at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.<>c__DisplayClass1_0.<AddOpenIddictServer>b__0(OpenIddictServerBuilder builder)
at Microsoft.Extensions.DependencyInjection.OpenIddictServerExtensions.AddServer(OpenIddictBuilder builder, Action`1 configuration)
at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.AddOpenIddictServer(IServiceCollection services)
1 Answer(s)
-
0
Hi,
You can check our documentation on how to deploy an AuthServer. See: https://abp.io/docs/latest/deployment/configuring-openiddict