Hi, We're currently using version 12.4.2 (.net, Angular) and created (and also recreated/updated) a couple of entites according to the current output from Power Tools (version 4.2.0).
It has the feature where the user gets almost instant search results while typing into the search field, almost known as state of the art today of course. It's realized like this with ngModelChange in the html part:
<div class="input-group mb-3">
<input
[(ngModel)]="filterText"
(ngModelChange)="getETests()"
name="filterText"
autoFocus
type="text"
class="form-control"
[placeholder]="l('SearchWithThreeDot')"
/>
<button class="btn btn-primary" type="submit" (click)="getETests()">
<i class="flaticon-search-1"></i>
</button>
</div>
...and like this in the corresponding ts part:
getETests(event?: LazyLoadEvent) {
if (this.primengTableHelper.shouldResetPaging(event)) {
this.paginator.changePage(0);
if (this.primengTableHelper.records && this.primengTableHelper.records.length > 0) {
return;
}
}
this.primengTableHelper.showLoadingIndicator();
this._eTestsServiceProxy
.getAll(
this.filterText,
this.titleFilter,
this.primengTableHelper.getSorting(this.dataTable),
this.primengTableHelper.getSkipCount(this.paginator, event),
this.primengTableHelper.getMaxResultCount(this.paginator, event),
)
.subscribe((result) => {
this.primengTableHelper.totalRecordsCount = result.totalCount;
this.primengTableHelper.records = result.items;
this.primengTableHelper.hideLoadingIndicator();
});
}
This causes two kinds of issues with entites having a couple more properties and especially thousands of records:
How can we fix that, especially the latter? It's really a problem when a user e.g. types "backend" into the search field, but ends up with results for "back pain", too, because the result for "back" came in last for whatever reason...
Thanks!
Hi, We're currently updating our project from Zero 8.1 (Angular, .net) to 12.4.2. Our project has an integration for Onlyoffice, a web based solution to edit office documents. Opening the editor still works fine, i.e. we provide it with basically a FileDto and a set of config parameters, then it downloads the document from our Zero backend and displays it for editing.
The issue now is when Onlyoffice needs to write an edited document back to our Zero backend. It authenticates via JWT with a pre-shared secret, therefor we extended AuthConfigurer.cs with the last if-block (configuration["OnlyOffice:IsEnabled"]):
public static class AuthConfigurer
{
public static void Configure(IServiceCollection services, IConfiguration configuration)
{
var authenticationBuilder = services.AddAuthentication();
if (bool.Parse(configuration["Authentication:JwtBearer:IsEnabled"]))
{
authenticationBuilder.AddJwtBearer(options =>
{
options.TokenValidationParameters = new TokenValidationParameters
{
// The signing key must match!
ValidateIssuerSigningKey = true,
IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(configuration["Authentication:JwtBearer:SecurityKey"])),
// Validate the JWT Issuer (iss) claim
ValidateIssuer = true,
ValidIssuer = configuration["Authentication:JwtBearer:Issuer"],
// Validate the JWT Audience (aud) claim
ValidateAudience = true,
ValidAudience = configuration["Authentication:JwtBearer:Audience"],
// Validate the token expiry
ValidateLifetime = true,
// If you want to allow a certain amount of clock drift, set that here
ClockSkew = TimeSpan.Zero
};
options.SecurityTokenValidators.Clear();
options.SecurityTokenValidators.Add(new IPSwebJwtSecurityTokenHandler());
options.Events = new JwtBearerEvents
{
OnMessageReceived = QueryStringTokenResolver
};
});
}
if (bool.Parse(configuration["IdentityServer:IsEnabled"]))
{
IdentityModelEventSource.ShowPII = true;
authenticationBuilder.AddIdentityServerAuthentication("IdentityBearer", options =>
{
options.Authority = configuration["IdentityServer:Authority"];
options.ApiName = configuration["IdentityServer:ApiName"];
options.ApiSecret = configuration["IdentityServer:ApiSecret"];
options.RequireHttpsMetadata = false;
});
}
if (bool.Parse(configuration["OnlyOffice:IsEnabled"]))
{
var securityKey = new SymmetricSecurityKey(System.Text.Encoding.UTF8.GetBytes(configuration["OnlyOffice:CallBackSecret"]));
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer("OnlyOfficeBearerToken",
options =>
{
options.TokenValidationParameters = new TokenValidationParameters()
{
ValidateAudience = false,
ValidateActor = false,
ValidateIssuer = false,
ValidateIssuerSigningKey = true,
ValidateLifetime = true,
IssuerSigningKey = securityKey
};
options.RequireHttpsMetadata = false;
options.SaveToken = true;
});
}
}
Then, a controller in the Zero Backend takes care of the calls returning from Onlyoffice like this:
[DisableAuditing]
[Authorize(AuthenticationSchemes = "OnlyOfficeBearerToken")]
[HttpPost]
[RequestSizeLimit(100_000_000)]
public async Task<ActionResult> OnlyOfficeCallbackHandler()
{
Claim payloadclaim = this.HttpContext.User.FindFirst(c => c.Type == "payload");
string body = payloadclaim?.Value;
//proceed body etc...
This worked well for many years, but now is broken since the update to 12.4.2, Onlyoffice giving the following errors:
Error: Error response: statusCode:302; headers:{"server":"nginx/1.21.1","date":"Mon, 01 Apr 2024 08:43:22 GMT","content-length":"0","connection":"keep-alive","location":"/Error?statusCode=401","www-authenticate":"Bearer error=\"invalid_token\", error_description=\"The signature key was not found; The signature key was not found\""
...and Zero giving the following errors:
Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10503: Signature validation failed. Token does not have a kid. Keys tried: '[PII of type 'System.Text.StringBuilder' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'. Number of keys in TokenValidationParameters: '1'.
Number of keys in Configuration: '0'.
Exceptions caught:
'[PII of type 'System.Text.StringBuilder' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
token: '[PII of type 'System.IdentityModel.Tokens.Jwt.JwtSecurityToken' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'. See https://aka.ms/IDX10503 for details.
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature(String token, JwtSecurityToken jwtToken, TokenValidationParameters validationParameters, BaseConfiguration configuration)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignatureAndIssuerSecurityKey(String token, JwtSecurityToken jwtToken, TokenValidationParameters validationParameters, BaseConfiguration configuration)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateJWS(String token, TokenValidationParameters validationParameters, BaseConfiguration currentConfiguration, SecurityToken& signatureValidatedToken, ExceptionDispatchInfo& exceptionThrown)
--- End of stack trace from previous location ---
We tried many things, like adding a kid, but it looks just like it's not possible anymore to extend AuthConfigurer.cs like before. Is there an easy way to fix it, or do we have to switch the approach?
This is how Onlyoffice works: https://api.onlyoffice.com/editors/save
Thanks for your help!
Hi, We're currently working on upgrading our project from Zero 8 to 12.4.2, .NET Core & Angular. Most of the work should be done and the project is running again in dev environment, i.e. frontend and backend up and running.
But after creating and deploying Docker images to our testing environment, we're getting the following error:
This happens after logging in (login page showed up properly), and the spinner keeps spinning forever. The backend seems to be running fine so far, at least we're able to log in as a tenant and query some app services through the swagger interface.
It's hard to find information about what NG0202 means, so at the moment I'm not even sure where to start fixing it. Any help is appreciated!
Hi,
Lately I was observing that our app server (Zero 8.1, .net Core) was occupying up to the limit of 100 db sessions/connections. So when I opened like PgAdmin, that resulted in PostgresException 53300, because the default pool config is also 100 connections. Yes, there was some more load on the app server than usual, but I'm observing that almost all sessions are in "idle" state with "Wait Event" "Client: ClientRead", "COMMIT" being the last SQL statement I guess. And "Last state changed at" is way more than 300 seconds for most of the sessions, many of them were several days old (300 seconds should be the default "Connection Idle Lifetime" from Postgres):
I don't think that this is normal behavior, or is it..? I also tested with Zero 12.1, it seems to behave the same and initiates a couple of sessions directly after startup. Those remain in the same idle state, too.
Thanks upfront!