ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
4.96k stars 722 forks source link

Add AuthenticationSchemes parameter to Authorization attribute [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] #7076

Open orlandommb opened 3 weeks ago

orlandommb commented 3 weeks ago

Product

Hot Chocolate

Is your feature request related to a problem?

hi @michaelstaib ! in my case a i got a asp.net core blazor server app, i mead the whole app is server rendered, i have a few apis implemented for basic usage im planning on using hotchocholate so i can make a client app and get rid of the server rendered components, but as of now i need to specify the [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] in the controllers so they can work with JWT and the blazor asp.net core identity authorization can work with the blazor components. i don't know if i explained the whole picture correctly, but the thing is i cannot set the JWT as default authorization Scheme as of now because that would disrupt the whole app authenticacion process and it would take a lo of code refactoring.

The solution you'd like

I think adding the AuthenticationSchemes parameter to Autorization attribute would be a life saver here.