ChilliCream / ChilliCream/graphql-platform

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

Open
#7,076 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Authorization
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

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 mean 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating Hot Chocolate's authorization attribute and its ASP.NET Core authorization integration, then compare how controller AuthenticationSchemes is represented; done means the attribute accepts the requested scheme without changing the app's default scheme, with coverage for JWT alongside Blazor Identity.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, authentication, authorization, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.