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

Authentication needs in ASP.NET Core going forward #42105

Open
1 task done
damienbod opened this issue Jun 9, 2022 · 7 comments
Open
1 task done

Authentication needs in ASP.NET Core going forward #42105

damienbod opened this issue Jun 9, 2022 · 7 comments
Assignees
Labels
area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer area-blazor Includes: Blazor, Razor Components area-identity Includes: Identity and providers enhancement This issue represents an ask for new feature or an enhancement to an existing one Pillar: Complete Blazor Web
Milestone

Comments

@damienbod
Copy link
Contributor

damienbod commented Jun 9, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

https://twitter.com/davidfowl/status/1534756765597720578

Describe the solution you'd like

I see 4 authentication grouped needs in ASP.NET Core

1- Easy to implement standard client authn (OpenID Connect)
2- Standalone with cookies and ASP.NET Core Identity (IDP solutions as well)
3- Certificate auth
4- AzureAD and Azure B2C client authn

I believe Microsoft should provide templates for just the client authn and docs + links to products about how to use or implement the second and third type. The Azure AD and Azure B2C client templates are already good.

If you have simple authn templates for OIDC clients for an ASP.NET Core API, Razor page, MVC, Blazor (WASM, BFF ASP.NET Core hosted, Server) which are easy to adapt after, then we have a good solution. As part of the solution then, docs about using with different IDPs would help as all IDPs have small differences.

HTTPS should be used with all these templates per default.

Additional context

No response

@javiercn javiercn added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer area-blazor Includes: Blazor, Razor Components area-identity Includes: Identity and providers labels Jun 9, 2022
@javiercn javiercn added this to the .NET 7 Planning milestone Jun 9, 2022
@ghost
Copy link

ghost commented Jun 9, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@HaoK HaoK self-assigned this Jun 13, 2022
@Lonli-Lokli
Copy link

Lonli-Lokli commented Jun 15, 2022

My scenario is not about Auth but about Auth integration testing with Minimal api.

One of the cases of my project is to be sure that all routes, including minimal, are protected with either Authorize or AllowAnonymous attributes.

Previously it was possible to loaf all types and search for ControllerBase inheritors and checking their metadata

Isn't it better to convert it to discussion?

@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Nov 1, 2022
@danroth27
Copy link
Member

Easy to implement standard client authn (OpenID Connect)

@damienbod Can share a bit more about what you believe is missing for this? Are you looking for a generic OIDC client setup that would work with most OIDC providers, similar to what we have for Blazor WebAssembly? Are there particular OIDC providers that you'd want to ensure this works with?

@damienbod
Copy link
Contributor Author

damienbod commented Nov 11, 2022

Hi @danroth27 thanks for asking. These are the projects we create for different clients which I think Microsoft could provide and would help the community developing secure applications. None of the templates are available per default.

Individual Accounts

  • none

External authentication

  • OpenID Connect client with Razor Pages
  • OpenID Connect client with Controller API
  • OpenID Connect Blazor WASM hosted in ASP.NET Core (BFF with cookies)
  • AAD Blazor WASM hosted in ASP.NET Core (BFF with cookies)
  • AAD B2C Blazor WASM hosted in ASP.NET Core (BFF with cookies)

I created three Blazor templates to fill this gap but believe Microsoft could do this for the community. The basic template of a Razor Page using an external OIDC server is missing. This would be really simple to support as all the auth middleware is already available. A user would only need to change the OIDC configuration for each different server requirement. A generic OIDC client setup would be great.

Here are the Blazor templates I created. These have no auth in the frontend and are simple to extend. The templates have also no third party dependencies either apart from the security headers package.

https://github.com/damienbod/Blazor.BFF.OpenIDConnect.Template

https://github.com/damienbod/Blazor.BFF.AzureAD.Template

https://github.com/damienbod/Blazor.BFF.AzureB2C.Template

If I need to implement my own identity provider, I use either IdentityServer or OpenIddict with ASP.NET Core Identity using their templates (which are very good) and have no need for any of the Microsoft templates using these packages. So apart from the Microsoft.Identity.Web templates for Razor Pages and APIs, Microsoft provide none of the templates which would be useful to me and probably to others as well.

This might be useful for some project as well:

Individual Accounts

  • Razor Page with Cookies and ASP.NET Core Identity
  • Blazor WASM hosted and ASP.NET Core Identity (BFF Cookies)

Greetings Damien

@Ponant
Copy link
Contributor

Ponant commented Jun 9, 2023

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/?view=aspnetcore-8.0
"The authentication support in Blazor WebAssembly is built on top of the OIDC Client Library (oidc-client.js), which is used to handle the underlying authentication protocol details."

I think with this it should not be that trivial for BFF on blazor wasm apps.

@Lonli-Lokli
Copy link

Lonli-Lokli commented Jun 9, 2023

Especially with the fact that https://github.com/IdentityModel/oidc-client-js is no longer maintained

@ghost
Copy link

ghost commented Oct 6, 2023

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT mkArtakMSFT added Pillar: Complete Blazor Web and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Nov 15, 2023
@mkArtakMSFT mkArtakMSFT modified the milestones: .NET 10 Planning, Backlog Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer area-blazor Includes: Blazor, Razor Components area-identity Includes: Identity and providers enhancement This issue represents an ask for new feature or an enhancement to an existing one Pillar: Complete Blazor Web
Projects
None yet
Development

No branches or pull requests