Starts in:
1 DAY
19 HRS
34 MIN
20 SEC
Starts in:
1 D
19 H
34 M
20 S

Activities of "RonaldR"

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v4.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:
  • I am trying to create a connection string resolver. i think inheriting the default one would solve my problem as i dont want to change the logic, i just need to decrypt an encrypted string. where would i implement this? do you have a good sample for me to look at?
Answer

ok, lets try this again. i have never had this issue with any other project, so there must be a way that i am just missing. the issue is when we are running in viual studio, in .net 5, our app crashes every 15 minutes when the cookie dies. how do we prevent this? this is causing a lot of problems for us, especially considering it takes a minutes or more to run our app every time because of the discovery process. i know there has to be a way to expect the cookie so that bearer token doesnt disappear. the token is valid for hours, so the fact it fails must be a cookie issue. how can we resolve this?

Answer

we added [unitofwork] to the functionthat gets the permissions and it seemed to have respolve the problem, i just dont understand why

Answer

we just moved to .net 5 and ver 4.0.0 of abp. what we found when we did this was wheni run the site it works, but if i stop it and restart it from visual studio we get a context already closed exception. after a bunch of playing around and testing i find that if i clear the cookie then i can restart it because it pushed me through the login again. so what it looks like is whe i return to the browser and a session or cookie is still alive from a previous session it fails to work, but if i delete the cookie and i am forced to authenticate then it works fine. have you seen this before?

Answer

we are also having a new cookie issue (i think it is cookie). we just moved to .net 5 and ver 4.0.0 of abp. what we found when we did this was wheni run the site it works, but if i stop it and restart it from visual studio we get a context already closed exception. after a bunch of playing around and testing i find that if i clear the cookie then i can restart it because it pushed me through the login again. so what it looks like is whe i return to the browser and a session or cookie is still alive from a previous session it fails to work, but if i delete the cookie and i am forced to authenticate then it works fine. have you seen this before?

I have a ticket for .net conversion, should i ask this question there insstead?

Answer

so your answer is that there is no way to extend that 15 minute window to allow for a longer time? if i walk away form my desk for 30 minutes for lunch my site dies while i am gone? cant we manually set the ispersistant to keep the cookie or prevent the session from dying?

Answer

that didnt seem to work either. i mdified the ConfigureAuthenication, removing the last attemot and adding the code you recommended. i am still runing in to the same issue. i started the site, logged in, used the menu and navigated to a page. i left and came back 45 minutes last. the sliding expiratation is set to 12 hours. when i tried to navigate to another page after the 45 minutes, it no longer knew who i was again and my application crashed.

private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
{
    context.Services.AddAuthentication()
        .AddJwtBearer(options =>
        {
            options.Authority = configuration["AuthServer:Authority"];
            options.RequireHttpsMetadata = false;
            options.Audience = "TFORM";
        });

    context.Services.ConfigureApplicationCookie(options =>
    {
        options.AccessDeniedPath = "/Identity/Account/AccessDenied";
        options.Cookie.Name = "TFORM";
        options.Cookie.HttpOnly = true;
        options.ExpireTimeSpan = TimeSpan.FromHours(12);
        options.LoginPath = "/Identity/Account/Login";
        // ReturnUrlParameter requires 
        //using Microsoft.AspNetCore.Authentication.Cookies;
        options.ReturnUrlParameter = CookieAuthenticationDefaults.ReturnUrlParameter;
        options.SlidingExpiration = true;
    });
}
Question

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v3.3.1
  • UI type: MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:
  • When we leave the site inactive for more than 15 minutes or there abouts it loses the identity. if i login then click on a page on the menu, then do nothing for 20 minutes then click on a new menu link, when it tries to rebuild the menus us use CurrentUser in the api to see who it logged in, but there is no user in there.
  • I tried adding this in the TFORMWebModule:
    context.Services.AddAuthentication()
                .AddCookie(options => {
                    options.SlidingExpiration = true;
                    options.ExpireTimeSpan = DateTimeOffset.UtcNow.AddHours(24).Offset;
                })
                .AddJwtBearer(options =>
                {
                    options.Authority = configuration["AuthServer:Authority"];
                    options.RequireHttpsMetadata = false;
                    options.Audience = "TFORM";
                });
        }

The AddJwtBearer was already there, i added the AddCookie setion, but that didnt work.

I alos checked the identity tables the accesstimeout and the identity timeout are all set to 31536000 so they shouldbe be expiring that quickly, i think thats about 8.5 hours, give or take.

so what am i missing?

Answer

maybe i just dont kow ef core well enough but i didnt see the answer to my question in that link. would adding this to the connection string solve the issue? ;Pooling=true;MinPoolSize=0;MaxPoolSize=10;

Question

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v3.3.1
  • UI type: MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:
  • How do we configure connection pooling? we are running against postgres. we have the website and the api backend and a hangfire server running asd part of this project. the connection to our database and the hangfire database. we have 4 developers working on the same postgres server but we are constantly running in to PostgresException: 53300: sorry, too many clients already.
  • My thought was connection pooling would handle this. in EF core, i know you are supposed to use AddDbContextPool instead of AddDbContext, but i do not see where AddDbContext is even being called in our code, so i am guessing it is handled in your code instead. Can you shed some light on the best practices for handling these connection pooling issues?
Showing 31 to 40 of 47 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06