Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.93k stars 441 forks source link

EasyAuth exception #8894

Open svenna opened 1 year ago

svenna commented 1 year ago

we have started to receive exceptions in easyauth for our httptriggered functions we are running azure functions in dotnet6-isolated, i have tried both with the function container and the app-service container our function works fine when we disable authentication. We did remedy the situation in one production environment by removing the azue function app and redeploying the infrastructure.

I have tried to restart the function service, update our own container but nothing fixes the issue and i cannot specify the version of easyauth container

2022-11-05T09:34:35.798303698Z fail: Microsoft.AspNetCore.Server.Kestrel[13] 2022-11-05T09:34:35.798352998Z Connection id "0HMLV21NTJB0D", Request id "0HMLV21NTJB0D:0000000F": An unhandled exception was thrown by the application. 2022-11-05T09:34:35.806213566Z System.PlatformNotSupportedException: Windows Cryptography Next Generation (CNG) is not supported on this platform. 2022-11-05T09:34:35.806232866Z at System.Security.Cryptography.RSACng..ctor() 2022-11-05T09:34:35.807030763Z at Microsoft.Azure.AppService.Middleware.JsonWebKey.GetSecurityKeys() in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/JsonWebKey.cs:line 100 2022-11-05T09:34:35.807048463Z at Microsoft.Azure.AppService.Middleware.Modules.OpenIdConnectConfig.RefreshOpenIdConnectKeys() in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/Config/IdentityProviders/OpenIdConnectConfig.cs:line 80 2022-11-05T09:34:35.807922359Z at Microsoft.Azure.AppService.Middleware.Modules.OpenIdConnectConfig.GetOpenIdConnectKeys(Boolean forceRefresh) in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/Config/IdentityProviders/OpenIdConnectConfig.cs:line 99 2022-11-05T09:34:35.807939459Z at Microsoft.Azure.AppService.Middleware.OpenIdConnectProvider.GetTokenValidationParameters(Boolean forceRefresh) in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/IdentityProviders/OpenIdConnectProvider.cs:line 476 2022-11-05T09:34:35.808732456Z at Microsoft.Azure.AppService.Middleware.OpenIdConnectProvider.b__32_0(Boolean forceRefresh) in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/IdentityProviders/OpenIdConnectProvider.cs:line 416 2022-11-05T09:34:35.809395153Z at Microsoft.Azure.AppService.Middleware.BearerTokenAuthenticationHelper.TryAuthenticateFromBearerToken(String siteName, HttpContextBase context, String headerName, String providerAlias, Boolean useLegacyClaims, Func2 getTokenValidationParametersFunc, AuthenticatedPrincipal& user, Exception& tokenValidationException, Boolean clearDefaultClaimsMapping) in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/BearerTokenAuthenticationHelper.cs:line 64 2022-11-05T09:34:35.809714552Z at Microsoft.Azure.AppService.Middleware.OpenIdConnectProvider.TryAuthenticateRequest(HttpContextBase context, AuthenticatedPrincipal& user, Exception& tokenValidationException) in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/IdentityProviders/OpenIdConnectProvider.cs:line 410 2022-11-05T09:34:35.809728752Z at Microsoft.Azure.AppService.Middleware.EasyAuthModule.AuthenticateAsync(HttpContextBase context) in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/EasyAuthModule.cs:line 874 2022-11-05T09:34:35.809746452Z at Microsoft.Azure.AppService.Middleware.EasyAuthModule.OnAuthenticateRequestAsync(HttpContextBase context) in /EasyAuth/Microsoft.Azure.AppService.Middleware.Modules/EasyAuthModule.cs:line 274 2022-11-05T09:34:35.809964051Z at Microsoft.Azure.AppService.Middleware.NetCore.AppServiceMiddleware.InvokeAsync(HttpContext context) in /EasyAuth/Microsoft.Azure.AppService.Middleware.NetCore/AppServiceMiddleware.cs:line 112 2022-11-05T09:34:35.815980627Z at Microsoft.Azure.AppService.MiddlewareShim.AutoHealing.AutoHealingMiddleware.Invoke(HttpContext context) in /EasyAuth/Middleware.Host/AutoHealing/AutoHealingMiddleware.cs:line 55 2022-11-05T09:34:35.818827015Z at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)

ramya894 commented 1 year ago

@svenna We will check this issue with our next level team and update you.