Skip to content

Integrate authorization into Blazor router #10491

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

Merged
merged 10 commits into from
May 28, 2019

Conversation

SteveSandersonMS
Copy link
Member

@SteveSandersonMS SteveSandersonMS commented May 23, 2019

Tests are in progress, but this does work. Update: tests are done and this is ready. This builds on my previous PR, #10487

Posting the PR a bit early in case anyone sounds any alarms about the way it determines what authorization attributes to apply (I've done it in a very simple way, but it's hard to compare against the giant metadata system used for controllers/pages).

@SteveSandersonMS SteveSandersonMS added the area-blazor Includes: Blazor, Razor Components label May 23, 2019
@SteveSandersonMS SteveSandersonMS added this to the 3.0.0-preview6 milestone May 23, 2019
@SteveSandersonMS
Copy link
Member Author

@rynowak @danroth27

On a design point, I want to emphasise that when authorization fails, although we don't display the page we do still use the layouts nominated by that page. This is because what other layout would we use? We can either:

  • Decide this is sensible and carry on
  • Decide we think the page's layout should not be used because it might contain sensitive content, and instead have a DefaultLayout on the Router, and use that instead. We also have a need for a DefaultLayout to fix Router displays NotFoundContent without any layout #10445, so maybe it's the right way forwards.

I'd lean towards the second option, but not blocking the merging of this PR for it.

@SteveSandersonMS SteveSandersonMS force-pushed the stevesa/blazor-authorization branch from f14a3f0 to f63cdce Compare May 24, 2019 11:20
@SteveSandersonMS SteveSandersonMS force-pushed the stevesa/blazor-routing-authorization branch from d1e1acd to a0e8506 Compare May 24, 2019 11:54
@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner May 24, 2019 12:21
@SteveSandersonMS SteveSandersonMS force-pushed the stevesa/blazor-routing-authorization branch from ea2b53a to d302bec Compare May 24, 2019 15:06
@SteveSandersonMS SteveSandersonMS changed the base branch from stevesa/blazor-authorization to master May 24, 2019 15:06
@rynowak rynowak merged commit bc011b5 into master May 28, 2019
@rynowak rynowak deleted the stevesa/blazor-routing-authorization branch May 28, 2019 01:12
@CornedBee
Copy link

This moved PageLayout out of the Layouts namespace, but failed to update the file location or the ref assembly.

@danroth27
Copy link
Member

@CornedBee Thanks for letting us know! Could you please open an issue for this so that we can track it?

@CornedBee
Copy link

@danroth27 #11240 is essentially this, except the reporter apparently found a workaround for his use case and closed the bug. Maybe you can reopen it? If not, I can create a new one.

@danroth27
Copy link
Member

@CornedBee Thanks for bringing this to our attention! I've reopened #11240 so that we can address this.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants