DuendeSoftware / Support

Support for Duende Software products
21 stars 0 forks source link

No authorization after redirect from authorization server and difference in claims in Blazor Web App SS+WASM project #1104

Closed DRyncewicz closed 8 months ago

DRyncewicz commented 8 months ago

Which version of Duende BFF are you using? 2.2.0

Which version of .NET are you using? 8.0 + Blazor web app interactive mode auto

Describe the bug After configuring the new project type blazor web app interactive auto exactly as in the documentation there is a problem with authorization. After successful login on the demo server https://demo.duendesoftware.com is redirected to his application page. At this point I have created components to display the user's claims on the Wasm side as well as the SS side. Without changing the nav menu page, SS has no status as authorized, while WASM does. After changing the component SS also has status as authorized but has other claims.

WASM ADITIONAL CLAIMS: bff:logout_url bff:session_expires_in bff:session_state

To Reproduce I am using the configuration from the duende documentation to set up BFF + authorization. I get an error when I log in and after redirecting to my application page I have components with authorization on the WASM side and Server Side. https://docs.duendesoftware.com/identityserver/v6/quickstarts/7_blazor/

Expected behavior Server side and WASM elements should be authorized equally and have access to the same claims.

Project: https://github.com/DRyncewicz/AuthBlazorWA/tree/master/AuthBlazorWA

josephdecock commented 8 months ago

We are actively working on an update to the BFF and new samples to show how to solve auth issues in blazor with .NET 8. For more details on my thoughts about the problems we're working on, see this comment, and this open issue in our samples repo. In the interest of keeping things organized, I'm closing this along with some other related issues, but feel free to provide feedback and comments in (https://github.com/DuendeSoftware/Samples/issues/142)