当前在auth / login中,您可以使用任何Get。如何限制某些内置服务的GET关键字。我们有一个最透彻的发现,指出不应通过Get关键字允许auth / login,而只能通过put或post。
答案 0 :(得分:1)
如果您引用的是HTTP GET请求,则可以使用以下命令注册Global Request Filter来短路Authenticate
HTTP GET请求:
GlobalRequestFilters.Add((req, res, requestDto) => {
if (requestDto is Authenticate auth && req.Verb == HttpMethods.Get)
{
res.StatusCode = (int)HttpStatusCode.MethodNotAllowed;
res.EndRequest();
}
});
默认情况下,我还在this commit的available on MyGet的中禁用了{{3}}中的GET Authenticate
请求(对于非OAuth提供商),可以通过以下方式重新启用它:
Plugins.Add(new AuthFeature(...) {
AllowGetAuthenticateRequests = req => true
});