Last post Oct 26, 2020 07:09 AM by yij sun
Member
1 Points
17 Posts
Oct 25, 2020 08:06 AM|iwcoetzer|LINK
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
Contributor
3730 Points
1428 Posts
Oct 26, 2020 07:09 AM|yij sun|LINK
Hi iwcoetzer,
Accroding to your description,you could trace log to check what the details of your error.And you could check your operations.
More details,you could refer to below article:
https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-identity-server?view=aspnetcore-3.1&tabs=visual-studio
Best regards,
Yijing Sun
Member
1 Points
17 Posts
Authorization Failed /connect/token 400 after publishing to host
Oct 25, 2020 08:06 AM|iwcoetzer|LINK
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
Contributor
3730 Points
1428 Posts
Re: Authorization Failed /connect/token 400 after publishing to host
Oct 26, 2020 07:09 AM|yij sun|LINK
Hi iwcoetzer,
Accroding to your description,you could trace log to check what the details of your error.And you could check your operations.
More details,you could refer to below article:
https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-identity-server?view=aspnetcore-3.1&tabs=visual-studio
Best regards,
Yijing Sun