-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
questionFurther information is requestedFurther information is requested
Milestone
Description
I just need to know how to get the error code UNAUTHENTICATED because when I use .AuthorizeWith I am getting a VALIDATION_ERROR.
here is a bit of startup.cs
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer();
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.TryAddSingleton<IAuthorizationEvaluator, AuthorizationEvaluator>();
services.AddTransient<IValidationRule, AuthorizationValidationRule>();
services.AddTransient((c) =>{
var authSettings = new AuthorizationSettings();
authSettings.AddPolicy("authenticated",p=>p.RequireClaim(ClaimTypes.Name));
return authSettings;
);
app.UseAuthentication();
app.UseAuthorization();
app.UseGraphQL<MySchema>("/api");
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested