Annotation-based [Authorize] problem for v13 #5928
-
I created a separate project for v13 using the copy-paste example from https://chillicream.com/docs/hotchocolate/v13/security/authorization If I use Code-first approach - I can see schema under localhost:port/graphql/ But for Annotation-based example with [Authorize] attribute, I see the inscription - "Schema unavailable" instead of the scheme. If I run the query an error appears:
HEADERSAccept: */ Please help me understand what is missing in the documentation... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
@vlad-karmalytskyi-swi I've seen this working in several places. Can you provide a reproduction of this issue in a github project? |
Beta Was this translation helpful? Give feedback.
-
@PascalSenn You can find project here Also, documentation strongly recommends using HotChocolate.AspNetCore.Authorization.AuthorizeAttribute But for v13 HotChocolate.AspNetCore.Authorization doesn't contain namespace AuthorizeAttribute, so in this test project I used HotChocolate.Authorization.AuthorizeAttribute |
Beta Was this translation helpful? Give feedback.
-
@vlad-karmalytskyi-swi Your Program.cs was wrong. You mixed the minimal API with the old API of .net core. I created a PR that fixes it: vlad-karmalytskyi-swi/HotChocolate-v13-Annotation-based-Authorize-issue#1 |
Beta Was this translation helpful? Give feedback.
@vlad-karmalytskyi-swi Your Program.cs was wrong. You mixed the minimal API with the old API of .net core. I created a PR that fixes it: vlad-karmalytskyi-swi/HotChocolate-v13-Annotation-based-Authorize-issue#1