Activities of "roberto.fiocchi"

https://github.com/abpframework/abp/issues/20483

Hi, do you think this issue could be related to my problem?

I sent you the logs of browser.

thanks

Ok, but can you explain what that piece of code does?

I sent you the logs from today's test. I tried without the fix and got the error. I added the fix and I don't get the error anymore. Can you explain what that piece of code does? Will this fix be a patch in the next release? Is this fix also compatible with AzureAd login?

Thanks, Roberto

I have sent the requested log Thanks

Not worked for me.

Error:

In console I see a warning:

I debug from Visual Studio with multi-launch project using IIS Express and then log in to the portal. I don't understand why the component is initialized twice and the second time the get passes a wrong token to the api It looks like a token handling issue because the component is in the layout instead of being on a page.

I get the same error if I publish on IIS

Can you try again by also logging out and logging back in? Maybe it's a problem that happens if you already have a token in cache

Thanks

Project sent via wetransfer. Thanks

From the logs I see that after the login a call to Books is made correctly, then UserInfo is called and this seems to change the state of the page so the component present in the toolbar is reloaded (reinitialized) only that in that case it sees the user logged in with the correct permissions but the next call fails for expired token

In case of a 401 error, apparently, the Client Proxy error handling it and the user is disconnected and sent back to the login session.

I already do it, did you read the code in the ticket?

protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
var isAutheticated = CurrentUser.IsAuthenticated;
var isAuthorized = await AuthorizationService.IsGrantedAsync(AbpSolution1Permissions.Books.Default);


    if (isAutheticated && isAuthorized)
    {
        await LoadBooks();
    }
}

Not work.

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-8.0#authorize-attribute Only use [Authorize] on @page components reached via the Blazor router. Authorization is only performed as an aspect of routing and not for child components rendered within a page. To authorize the display of specific parts within a page, use AuthorizeView instead.

Showing 11 to 20 of 95 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13