Aktualisieren der .NET 6-Anwendung in Docker: „Bei der Verarbeitung der Remote-Anmeldung ist ein Fehler aufgetreten. DerC#

Ein Treffpunkt für C#-Programmierer
Guest
 Aktualisieren der .NET 6-Anwendung in Docker: „Bei der Verarbeitung der Remote-Anmeldung ist ein Fehler aufgetreten. Der

Post by Guest »

EDIT: Ich habe das zu früh gepostet. Ich kann den Container lokal ausführen. Es läuft nicht erfolgreich in der Azure-Web-App mit den folgenden Problemen
Ich führe meine .NET 6-Anwendung nativ auf einer Azure-Linux-Web-App aus, d. h. nur durch Komprimieren Der Code und die Bereitstellung funktionieren einwandfrei.
Ich versuche jetzt, meine Anwendung in einem Docker-Container auszuführen, und erhalte eine Ausnahme, wenn ich ein Token von meinem Identitätsanbieter erhalte. Ich bin mir nicht sicher, warum es einen Unterschied zwischen der Ausführung auf einer Linux-Webanwendung und der anschließenden Ausführung in einem Linux-basierten Container geben sollte, abgesehen vielleicht von einigen Bibliotheksunterschieden?

Token-Antworttext konnte nicht als JSON analysiert werden. Statuscode: 403. Inhaltstyp: text/html IDX21106: Fehler beim Deserialisieren in JSON: 'System.String'


Beim Bearbeiten der Remote-Anmeldung ist ein Fehler aufgetreten. Der Token-Antworttext konnte nicht als JSON analysiert werden. Statuscode: 403. Inhaltstyp: text/html IDX21106: Fehler bei der Deserialisierung in JSON: 'System.String'

Dies ist meine Docker-Datei

Code: Select all

FROM mcr.microsoft.com/dotnet/aspnet:6.0

RUN echo "deb http://deb.debian.org/debian bookworm contrib non-free non-free-firmware" > /etc/apt/sources.list.d/contrib.list

RUN apt-get clean all && \
apt update && \
apt install -y wget libgdiplus ttf-mscorefonts-installer fontconfig fonts-liberation && \
fc-cache -fv &&  \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY output/ .

ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true

CMD ["dotnet", "API.dll"]
Der einzige Unterschied zwischen dem ersten und dem zweiten Szenario besteht in dieser Docker-Datei und der Bereitstellung in der neuen Linux-Webanwendung, die Container unterstützt.
Ausnahmen von der Anwendung Einblicke

Code: Select all

Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolException:
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__22.MoveNext (Microsoft.AspNetCore.Authentication.OpenIdConnect, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__19.MoveNext (Microsoft.AspNetCore.Authentication.OpenIdConnect, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Inner exception System.ArgumentException handled at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__22.MoveNext:
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectMessage..ctor (Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__22.MoveNext (Microsoft.AspNetCore.Authentication.OpenIdConnect, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)

Code: Select all

System.Exception:
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1+d__11.MoveNext (Microsoft.AspNetCore.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware+d__6.MoveNext (Microsoft.AspNetCore.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol+
d__226`1.MoveNext (Microsoft.AspNetCore.Server.Kestrel.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Inner exception Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolException handled at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1+d__11.MoveNext:
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__22.MoveNext (Microsoft.AspNetCore.Authentication.OpenIdConnect, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral,  PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__19.MoveNext (Microsoft.AspNetCore.Authentication.OpenIdConnect, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Inner exception System.ArgumentException handled at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__22.MoveNext:
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectMessage..ctor (Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler+d__22.MoveNext (Microsoft.AspNetCore.Authentication.OpenIdConnect, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Image

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post