Thanks.
So i tried to use Openiddict. I can get authorization code with https://localhost:44301/connect/authorize?client_id=client&response_type=code
Then i used this code with client_id and client_secret parameters, i got access_token.
With this access_token i can call https://localhost:44301/api/services/app/WinStageHosts/GetAll
But when i try this api call (https://localhost:44301/api/services/app/WinStageHosts/CreateOrEdit) with releated json input from body i got the following error.
ERROR 2025-02-06 11:43:32,595 [29 ] idateAntiforgeryTokenAuthorizationFilter - The required antiforgery header value "X-XSRF-TOKEN" is not present. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery header value "X-XSRF-TOKEN" is not present. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Abp.AspNetCore.Mvc.Antiforgery.AbpValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context) INFO 2025-02-06 11:43:32,597 [29 ] c.Infrastructure.ControllerActionInvoker - Authorization failed for the request at filter 'Abp.AspNetCore.Mvc.Antiforgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'. INFO 2025-02-06 11:43:32,598 [29 ] icrosoft.AspNetCore.Mvc.StatusCodeResult - Executing StatusCodeResult, setting HTTP status code 400 INFO 2025-02-06 11:43:32,598 [29 ] c.Infrastructure.ControllerActionInvoker - Executed action Smart.Inventory.WinStageHostsAppService.CreateOrEdit (Smart.Application) in 5.0783ms INFO 2025-02-06 11:43:32,598 [29 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'Smart.Inventory.WinStageHostsAppService.CreateOrEdit (Smart.Application)' INFO 2025-02-06 11:43:32,599 [29 ] Microsoft.AspNetCore.Hosting.Diagnostics - Request finished HTTP/1.1 POST https://localhost:44301/api/services/app/WinStageHosts/CreateOrEdit - 400 - - 48.0187ms
Can you tell me how can i do ? Is there a table to store tokens and lifetime's. Is not in cache ? I think tables only track names to reference this token in cache ?
I mean,
I have lots of Unix/Linux server and i want to send telemetry data like hostname, memory to my backend (aspnetzero) system via curl command. And i want to schedule this command with crontab.
At backend system i want to create a Bearer token not expired or expire in 1 or 2 years. And i want to use this bearer token in curl command. I dont want to write username or password at crontab command or script.
Muhittin
Hi,
I go the following error when i click "Export to Excel".
selectedColumns was null
AspNetZero Core, MVC 14.0.0
I created entity via RAD Tools and only 1 property names "Name".
Hi,
I want to write an application that collects data from external clients. That is, it collects data externally using curl, without using a username and password, only using tokens. How can I do this?
Like Jira. In jira we create a token with not expired. And clients connect to Jira with this token. I want to user similar senario on asp net zero app.
Muhittin
I solved the problem. Its about source data column size. It is not releated to row count.
Hi,
I got 3376 record from a query and i want to insert this result to my application;
I am using 13.1.1
Code is;
var ajaxResponse = JsonConvert.DeserializeObject<UCMDBCis>(content);
int i = 0;
foreach (UCMDBContent data in ajaxResponse.Cis)
{
var filteredHostname = _stageHostRepository.GetAll()
.WhereIf(!string.IsNullOrWhiteSpace(data.Properties.Name), e => false || e.Hostname.Contains(data.Properties.Name))
.ToList();
if (filteredHostname.GetEnumerator().MoveNext() == false)
{
CreateOrEditStageHostDto stageHost = new CreateOrEditStageHostDto();
stageHost.FeedSourceId = filteredFeedSource.FirstOrDefault().Id;
stageHost.Hostname = data.Properties.Name;
Create(stageHost);
}
i++;
if (i == 500) { break; }
}
This code is running successfully. But where i remove 500 record count segment i got the following error;
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
How can i insert thousands of records ?
Sorry state is refreshing, page not refreshing. There is no problem.
Whıt healtchecks not refreshing every 10 second.
At healthchecks-ui page, i saw "Polling interval: secs" How many seconds ? It is empty
My config is;
}, "HealthChecks": { "HealthChecksEnabled": true, "HealthChecksUI": { "HealthChecksUIEnabled": true, "HealthChecks": [ { "Name": "Smart.Web.Host", "Uri": "http://localhost:9901/health" } ], "EvaluationTimeOnSeconds": 10, "MinimumSecondsBetweenFailureNotifications": 60 } } }
How can i refresh every x second ? Is there any other parameter ?
Muhittin
I found the problem.
I add the following line to app.settings.production file
"HomePageUrl": "",
HomeController.cs is checking environment is dev or prod. Local pc is dev so core app is running. But on server dont redirect to /Ui/login page.