dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.24k stars 5.88k forks source link

Creating openid connect authentication/authorization is just a struggle with your docs #23877

Open shoter opened 3 years ago

shoter commented 3 years ago

This sentence

When you use this workflow, the ASP.NET Core Identity middleware is not needed, because all user information storage and authentication is handled by the Identity service.

It's hard to make out what you really mean for someone configuring everything for the first time. Do I need to remove some code connected with Identity? First thing that comes into mind is to remove:

            services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = false)
                .AddEntityFrameworkStores<ApplicationDbContext>();

But it is not middleware. As a reader I am just confused what you want to tell me. Example project with some setup would be greatly appreciated.

Even example code to see what I need to remove would be great.


Document Details

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

tdykstra commented 3 years ago

@mjrousos Can you help with this question?

shoter commented 3 years ago

It's not a question per se but rather a call to improve the documentation. Resolving question is not helpful compared to improving documentation on how to set authentication properly.

Thing that did not work for me with that example: I need to change default challenge schema to:

                options.DefaultChallengeScheme =
                   OpenIdConnectDefaults.AuthenticationScheme;

It's a pity schemes differences were not addressed here especially when there is openId default auth schema.

It would be great to have working example for example with docker compose.