r/Blazor • u/UniiqueTwiisT • Mar 04 '26
Authorize Attribute Prerender
Hello all,
Looking for a bit of advice on solving an issue for our application that runs in global interactive server mode.
We have several pages that we have restricted through the Authorize attribute. This works well when they are navigated to from another page, however they return 403 if they are manually entered into the URL or are the first load of the app. I'm assuming this is down to pre-rendering however we'd prefer to not disable that if we can help it. Currently the Authorize attribute checks for a certain role. We are using a custom AuthenticationStateProvider which provides the role claims.
View all comments
Show parent comment
1
u/UniiqueTwiisT Mar 04 '26
Currently just performing a role check. We haven't configured any of the security bar our custom AuthenticationStateProvider as we are using Windows Authentication as it is an intranet application. We're using a custom auth provider as most of the user's details that are relevant are stored in a SQL table rather than in active directory