I think my issue same as here https://support.abp.io/QA/Questions/1682/API-Fails-after-Authenticated
But I dont know what did he resolved it? Should I run .Host project before run Blazor project?
I will get and send you that code after lunch. Thank you
It gives another error
2022-03-08 09:28:46.233 +07:00 [ERR] An unhandled exception has occurred while executing the request.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'.
---> System.IO.IOException: IDX20807: Unable to retrieve document from: 'System.String'. HttpResponseMessage: 'System.Net.Http.HttpResponseMessage', HttpResponseMessage.Content: 'System.String'.
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager1.GetConfigurationAsync(CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.ConfigurationManager
1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c__DisplayClass0_0.<
But when I add my custom JWT bear, it gives error so I think I can only use this default or custom JWT, is that right?
Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:Microsoft.Extensions.Hosting.IHostedService[] -> Microsoft.AspNetCore.Hosting.GenericWebHostService -> Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer -> Microsoft.AspNetCore.Authentication.AuthenticationSchemeProvider.
---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions1[Microsoft.AspNetCore.Authentication.AuthenticationOptions])' on type 'AuthenticationSchemeProvider'. ---> System.InvalidOperationException: Scheme already exists: Bearer at Microsoft.AspNetCore.Authentication.AuthenticationOptions.AddScheme(String name, Action
1 configureBuilder)
at Microsoft.AspNetCore.Authentication.AuthenticationBuilder.<>c__DisplayClass4_0`2.
And now I got this error when send request from Chrome Plugin
2022-03-04 11:37:00.524 +07:00 [INF] Request starting HTTP/2 POST https://localhost:44307/API/Login application/json 37
2022-03-04 11:37:00.526 +07:00 [DBG] CORS request made for path: /API/Login from origin: chrome-extension://pjidmkdphpgkmfmengaddlpjojjpdifo but was ignored because path was not for an allowed IdentityServer CORS endpoint
2022-03-04 11:37:00.526 +07:00 [INF] No CORS policy found for the specified request.
2022-03-04 11:37:00.527 +07:00 [INF] Executing endpoint 'DruidAI.Blazor.Controllers.APIController.Login (DruidAI.Blazor)'
2022-03-04 11:37:00.527 +07:00 [INF] Route matched with {action = "Login", controller = "API", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.ActionResult
1[DruidAI.Blazor.Model.LoginRespone]] Login(DruidAI.Blazor.Model.LoginRequest) on controller DruidAI.Blazor.Controllers.APIController (DruidAI.Blazor).
2022-03-04 11:37:00.528 +07:00 [ERR] The required antiforgery header value "RequestVerificationToken" is not present.
2022-03-04 11:37:00.528 +07:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'.
2022-03-04 11:37:00.528 +07:00 [INF] Executing ObjectResult, writing value of type 'Microsoft.AspNetCore.Mvc.ProblemDetails'.
2022-03-04 11:37:00.528 +07:00 [INF] Executed action DruidAI.Blazor.Controllers.APIController.Login (DruidAI.Blazor) in 0.8391ms
2022-03-04 11:37:00.528 +07:00 [INF] Executed endpoint 'DruidAI.Blazor.Controllers.APIController.Login (DruidAI.Blazor)'
2022-03-04 11:37:00.533 +07:00 [DBG] Added 0 entity changes to the current audit log
2022-03-04 11:37:00.533 +07:00 [DBG] Added 0 entity changes to the current audit log
2022-03-04 11:37:00.533 +07:00 [DBG] Added 0 entity changes to the current audit log
2022-03-04 11:37:00.534 +07:00 [INF] Request finished HTTP/2 POST https://localhost:44307/API/Login application/json 37 - 400 - application/problem+json;+charset=utf-8 9.3609ms
It seems have this log 2022-03-04 10:18:11.395 +07:00 [INF] Request starting HTTP/1.1 POST https://localhost:44307/api/Values application/json 10 2022-03-04 10:18:11.397 +07:00 [INF] Identity.Application was not authenticated. Failure message: Unprotect ticket failed 2022-03-04 10:18:11.398 +07:00 [INF] Identity.Application was not authenticated. Failure message: Unprotect ticket failed 2022-03-04 10:18:11.398 +07:00 [INF] Identity.Application was not authenticated. Failure message: Unprotect ticket failed 2022-03-04 10:18:11.398 +07:00 [INF] Executing endpoint 'DruidAI.Blazor.Controllers.ValuesController.Post (DruidAI.Blazor)' 2022-03-04 10:18:11.399 +07:00 [INF] Route matched with {action = "Post", controller = "Values", area = "", page = ""}. Executing controller action with signature Void Post(System.String) on controller DruidAI.Blazor.Controllers.ValuesController (DruidAI.Blazor). 2022-03-04 10:18:11.402 +07:00 [ERR] The required antiforgery cookie ".AspNetCore.Antiforgery.qD9znlZol-M" is not present. 2022-03-04 10:18:11.402 +07:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'. 2022-03-04 10:18:11.404 +07:00 [INF] Executing ObjectResult, writing value of type 'Microsoft.AspNetCore.Mvc.ProblemDetails'. 2022-03-04 10:18:11.404 +07:00 [INF] Executed action DruidAI.Blazor.Controllers.ValuesController.Post (DruidAI.Blazor) in 5.0763ms 2022-03-04 10:18:11.404 +07:00 [INF] Executed endpoint 'DruidAI.Blazor.Controllers.ValuesController.Post (DruidAI.Blazor)' 2022-03-04 10:18:11.728 +07:00 [DBG] Added 0 entity changes to the current audit log 2022-03-04 10:18:11.730 +07:00 [DBG] Added 0 entity changes to the current audit log 2022-03-04 10:18:11.741 +07:00 [DBG] Added 0 entity changes to the current audit log 2022-03-04 10:18:11.744 +07:00 [INF] Request finished HTTP/1.1 POST https://localhost:44307/api/Values application/json 10 - 400 - application/problem+json;+charset=utf-8 348.5922ms
What does it mean?