Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blazor server] On demand principal revalidation #39932

Open
javiercn opened this issue Feb 2, 2022 · 4 comments
Open

[Blazor server] On demand principal revalidation #39932

javiercn opened this issue Feb 2, 2022 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components design-proposal This issue represents a design proposal for a different issue, linked in the description feature-blazor-server feature-blazor-server-auth
Milestone

Comments

@javiercn
Copy link
Member

javiercn commented Feb 2, 2022

Summary

Blazor server apps authenticate the user at the beginning of the circuit lifetime and offer a mechanism for updating the principal when used in conjunction with identity. The way Blazor Server handles authentication is confusing for some users since they are used to the authentication to be re-validated on every request/response, as opposed to Blazor, for which the authentication by default lasts the entire lifetime of the circuit.

Motivation and goals

  • This aspect of Blazor server authentication is a common point of confusion we receive frequent feedback about.
  • There are plenty of issues on our GH repo about this problem.

In scope

Provide a mechanism that lets the server initiate a request for re-validating the user credentials and updating the Principal accordingly.

The general idea is to provide an endpoint that receives a protected payload TBD, authenticates the user and returns a protected payload with the updated authentication context that the server can validate and use to update the Principal before the next authorization check.

Out of scope

Re-validating authentication is limited to authenticating the user against the schemes defined by a policy, there is no way to customize this process besides that.

Risks / unknowns

This is a security related feature, so it needs to be thread model analysis.

Examples

@attribute [RevalidateAuthentication]

The authorizerouteview would check this attribute on the handler and act accordingly.

There would also be an imperative API that can be used from event handlers to check this.

await AuthStateProvider.RevalidateAuthentication()`
@javiercn javiercn added design-proposal This issue represents a design proposal for a different issue, linked in the description area-blazor Includes: Blazor, Razor Components feature-blazor-server-auth feature-blazor-server labels Feb 2, 2022
@javiercn javiercn added this to the Backlog milestone Feb 2, 2022
@ghost
Copy link

ghost commented Feb 2, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ghost
Copy link

ghost commented Dec 5, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@danroth27
Copy link
Member

Dependent on #5297

@danroth27
Copy link
Member

The SignalR folks are planning to start investigating #5297 in the .NET 10 timeframe, but we don't expect this to land for .NET 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components design-proposal This issue represents a design proposal for a different issue, linked in the description feature-blazor-server feature-blazor-server-auth
Projects
None yet
Development

No branches or pull requests

4 participants