Activities of "lan.dang"

Answer

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.ConfigurationManager1.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.<

Answer

Thank you I can get it work, but what is different about name? If I put second as default, it works (as image below) But if i put second with "CustomJWT" it does not work, and return 302 Found error. Does it take only default Bearer?

Answer

I keep this and add new one this

But it does not work, give same problem

Answer

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, Action1 configureBuilder) at Microsoft.AspNetCore.Authentication.AuthenticationBuilder.<>c__DisplayClass4_0`2.

Answer

Hi Maliming again, I have a question related to JWT. I saw in our solution there is a configure of JWT already So that I can not add JWT bear configure (I have code to use Security key). In this case, how can I generate token to use for API? The token generated by using security key is not working

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.ActionResult1[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?

  • ABP Framework version: v5.1
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I am creating API using controller in Blazor project, API works with Get method but not Post method, I call it from Postman and it returns Bad Request. My controller is simple

Here is my Start Up

It works if I runs controller in fresh Blazor project, I want to integrate it to current ABP.IO solution. Please help

Answer

Thank you

Answer

Yes that is what I need, can you send me these link to source code?

Zobrazeno od 111 do 120 z celkem 144 záznamů
Made with ❤️ on ABP v8.2.0-preview Updated on března 25, 2024, 15:11