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

Add two sections with details about scaffolding into server-side blazor apps #15651

Closed
javiercn opened this issue Nov 11, 2019 — with docs.microsoft.com · 18 comments · Fixed by #17940
Closed

Add two sections with details about scaffolding into server-side blazor apps #15651

javiercn opened this issue Nov 11, 2019 — with docs.microsoft.com · 18 comments · Fixed by #17940

Comments

Copy link
Member

With auth.
Without auth.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@guardrex
Copy link
Collaborator

Since I'm not currently aware of any difference for scaffolding into a Blazor Server app (configured for auth from the template or without) over a web app, I'll need more guidance to work this. Let's put it on the Blazor.Docs project for more info when this is triaged.

@Rick-Anderson
Copy link
Contributor

Rick-Anderson commented Nov 19, 2019

Related: dotnet/aspnetcore#16972

@guardrex wait until dotnet/aspnetcore#16972 closes and then create the doc off the readme.

@guardrex
Copy link
Collaborator

guardrex commented Nov 20, 2019

... and cross-link from ASP.NET Core Blazor authentication and authorization (with clarity that this is for Blazor Server).

@mkArtakMSFT
Copy link
Member

@javiercn what details are you interested in here to be covered?

@guardrex guardrex removed the DR label Dec 3, 2019
@guardrex guardrex added Pri2 and removed Source - Docs.ms Docs Customer feedback via GitHub Issue labels Dec 7, 2019
@Rick-Anderson
Copy link
Contributor

@javiercn @mkArtakMSFT bot closing due to lack of information.

@guardrex guardrex removed their assignment Dec 13, 2019
@danroth27 danroth27 reopened this Dec 13, 2019
Copy link

Running the Identity scaffold on Blazor server Core 3.1 does not work. I created a new Server app with local identity in my SQL database. The error is "Scheme already exists: Identity.Application".

We really need instructions for Blazor for 1) run the scaffolding, 2) create ApplicationUser custom class, and 3) change the UserId in database from nvarchar(450) to Guid. BTW, the use of nvarchar(450) prevents the ability to use compound primary keys.

Copy link

Ainda não conseguimos utilizar 'Scaffold Identity' com Blazor, mesmo na versão .NET Core 3.1.
Alguma previsão?

@Rick-Anderson
Copy link
Contributor

@VR-Architect

The error is "Scheme already exists: Identity.Application".

That has nothing to do with Blazor. I've seen that error when you create a new web app with authorization, register a user, then scaffold.

Drop the DB, run update and try again.
Verify that \Areas\Identity\IdentityHostingStartup.cs doesn't have a duplicate AddDefaultIdentity call.

change the UserId in database from nvarchar(450) to Guid.

See Identity model customization in ASP.NET Core

Copy link

Is it possible to add an example with some custom Identity provider implementation?
For example this can be useful:
https://github.com/Robynhu/AspNetCore.Identity.PostgreSQL
It uses PostgreSQL as a user storage and does not use EF. No any Migrations etc, only creation db structure by script.

@guardrex
Copy link
Collaborator

guardrex commented Feb 10, 2020

@mkArtakMSFT I've researched this a bit more. The issue that I opened (and just closed) at #16944 is a dup of this issue, so I'm going to work the scenarios from here.

I took a look at the scaffolding topic at ...

https://docs.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.1&tabs=visual-studio

... and it's similar ... the steps are about the same, but that topic so RP/MVC-ish (code and markup examples), that I think we'd be better served by placing the Blazor scaffolding into Blazor's auth topic (probably less attracive) or creating a new topic for it in the Blazor TOC (probably the better choice). Conversely, the current scaffolding topic would need work to make it more generic so that it would apply to all three scenarios (RP, MVC, and Blazor).

🤔 Your thoughts?

@Rick-Anderson
Copy link
Contributor

creating a new topic for it in the Blazor TOC (probably the better choice).

That gets my non-counting vote. I think that's better than adding Blazor to the existing doc.

@guardrex
Copy link
Collaborator

Yeah ... it's gonna be a fight to get it in there .... looks a bit overhaul-ish to make that work and avoid lots of duplication in that topic (i.e., if just sections are added). If we go with a little Blazor version of it over here, I can work it right after those high priority Blazor docs issues get worked, and those go forward right after the current crop of PRs merge.

@mkArtakMSFT
Copy link
Member

@guardrex I think having a generic identity scaffolding topic is fine, and for the Blazor TOC, we can have a tiny writeup, where we can say something like "The auth for Blazor Server is exactly what it is for MVC and/or RP, so please look into there (link here) for how to scaffold identity).

@guardrex
Copy link
Collaborator

guardrex commented Feb 11, 2020

@Rick-Anderson Scaffold Identity is one of your 👶. Resolving this issue might require significant structural and content changes to the topic. I only looked briefly, but that was my impression given the examples and markup shown. Do you want me to go ahead and stomp around in there 🐾, or would you prefer to work this one?

@Rick-Anderson
Copy link
Contributor

@guardrex can't you just add a Blazor section outlining what needs to be done? Do we need a complete walk through like I provided for MVC/RP?

@guardrex
Copy link
Collaborator

I can try. I have a feeling that there will be a lot of duplication with what you have there. The current guidance is about right for Blazor ... it's just that all of the examples/markup aren't the same.

Let's do that ... I'll try it with only sections and see how it composes. If it starts to go badly tho ... hitting problems ... I'll ping back here with it for further discussion.

@guardrex
Copy link
Collaborator

guardrex commented Apr 8, 2020

@guardrex
Copy link
Collaborator

@bdnts ... I've finally come to a day that I can dedicate to this one. Thanks for your notes over on dotnet/aspnetcore#19148.

I think I see what I'd like to do on the PR with this to get the ball rolling with basic coverage that we can revise and extend thereafter. I'll ping you on the PR, which should land this evening.

You spoke about converting some number of page-based auth endpoints over to Razor components. Idk what the design will be later for that ... will they make a set of component-based auth endpoints for the OOB experience? I'll 🙏 to the server gods for it! ... but I'd like to link a set of components from a Blazor node sample folder attached to the topic ... not show them ... just cross-link a set of them. Potentially, it could save a massive number of developer hours. If you have a set, would you be willing to provide them?

I understand from your notes that the Login page presents a major challenge, and I get that devs have been using an API-based approach for that. Those points are probably worth mentioning because devs are going to want to know what's possible today. Did you ultimately work out a SignalR approach? If not, which approach did you land on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment