'Login does not work in docker container for abp io app

i have created abp io app from blazor sql server not tierd template. i have ran app locally and its working fine. Then ive build docker image for it and made compose for sql server and my app image. Container is working fine and i can connect to db.

Problem is that auth is not working. When i try to log in nothing happens. Not sure whats wrong or where to look.

dockerfile


WORKDIR /app
COPY . .

ENTRYPOINT ["dotnet", "SimplyAir.Blazor.dll"]

p.s. there is a ps1 build script that builds app dlls. this dockerfile just copies them and uses aspnet 5 runtime.

docker-compose.yml

services:
 simply-air-ms-sql-server:
  image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
  environment:
   ACCEPT_EULA: "Y"
   SA_PASSWORD: "Pa55word."
   MSSQL_PID : Express
  ports:
   - "1445:1433"
 simplyair_host:
  image: simplyair/host
  environment:
    ASPNETCORE_ENVIRONMENT: Release
  ports:
   - 8081:80
  volumes:
   - "./Host-Logs:/app/Logs"

appsettings.Release.json

{
  "App": {
    "SelfUrl": "http://localhost:8081",
    "CorsOrigins": "http://localhost:8081"
  },
  "ConnectionStrings": {
    "Default": "Server=simply-air-ms-sql-server;Database=SimplyAirRelease;User Id=SA;Password=Pa55word."
  },
  "AuthServer": {
    "Authority": "https://localhost:8081",
    "RequireHttpsMetadata": "true"
  }
}

only error in Log.txt in container is

[ERR] An exception was thrown while deserializing the token.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
 ---> System.Security.Cryptography.CryptographicException: The key {0f13b215-a101-449a-8a97-389b992dc5fd} was not found in the key ring.
   at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
   at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData, Boolean ignoreRevocationErrors, Boolean& requiresMigration, Boolean& wasRevoked)
   at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetCookieTokenDoesNotThrow(HttpContext httpContext)

and some warning

[WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'.
[WRN] The cookie 'idsrv.session' has set 'SameSite=None' and must also set 'Secure'.
[WRN] The cookie '.AspNetCore.Identity.Application' has set 'SameSite=None' and must also set 'Secure'.

and also there is something in dev console enter image description here

not sure if i have provided enough info so please if u need more tell me



Solution 1:[1]

I had a similar issue with abp.io MVC Non-Tiered app. I built a docker container and the login screen would not work as you describe. I used the network tool in chrome and saw that the Account/Login api endpoint was coming up as 404. I had to change my docker configuration to utilize https endpoints instead of http and then it worked. I also had to pass in the following environment variables in docker-compose for kestrel to work with https.

- ASPNETCORE_Kestrel__Certificates__Default__Path=/etc/ssl/certs/localhost.pfx
- ASPNETCORE_Kestrel__Certificates__Default__Password=YOURPASSWORD

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 STRTUP