develop #5
@ -83,6 +83,17 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
 | 
				
			|||||||
            ValidateIssuerSigningKey = true,
 | 
					            ValidateIssuerSigningKey = true,
 | 
				
			||||||
            IssuerSigningKey = secKey
 | 
					            IssuerSigningKey = secKey
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					        x.Events = new JwtBearerEvents
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            OnChallenge = context =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                context.HandleResponse();
 | 
				
			||||||
 | 
					                context.Response.StatusCode = 200;
 | 
				
			||||||
 | 
					                context.Response.ContentType = "application/json";
 | 
				
			||||||
 | 
					                return context.Response.WriteAsJsonAsync(new ReturnTemplate(401,"你提供了一个错误的Token,所以我们无法验证你的身份,唔......",null));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    .AddCookie("Identity.External").AddCookie("Identity.Application");
 | 
					    .AddCookie("Identity.External").AddCookie("Identity.Application");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user