locked
Authorization Failed /connect/token 400 after publishing to host RRS feed

  • Question

  • User1809093284 posted

    Hi

    I have a simple Blazor webassembly hosted app.

    It works fine in my development environment.

    However, after I do a dotnet publish -c Release and copy the Release published outputs to my hosting server I cannot log in?

    The hosting server does have an ssl certificate installed, and I changed my appSettings.json to look like this:

    {
      "ConnectionStrings": {
        "DefaultConnection": "DataSource=app.db"
      },
      "Logging": {
          "LogLevel": {
          "Default": "Information",
          "Microsoft": "Warning",
          "Microsoft.Hosting.Lifetime": "Information"
          }
        },
      
        "IdentityServer": {
          "Key": {
            "Type": "File",
            "FilePath":"wildcard.amoebaservices_online.pfx",
            "Password":"123456"
          },
          "Clients": {
            "BlazorH1.Client": {
              "Profile": "IdentityServerSPA"
            }
        }
        ,
    "AllowedHosts": "*"
    }
    }

    However, I still receive this scripting error when i click on the Log In menu link:

    info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
          Authorization failed.
    AuthenticationService.js:1 POST https://www.amoebaservices.online/connect/token 400

    Sunday, October 25, 2020 8:06 AM

All replies