How to get remote IP Address of client in identity

2019-07-17 06:03发布

Is there a property in the context variable (ResourceOwnerPasswordValidationContext) that lets me access the IP address of the client sending the initial request for an auth.

1条回答
We Are One
2楼-- · 2019-07-17 06:53

There is no information like that for you to grab within that context. Your only Option is to inject IHttpContextAccessor into your ResourceOwnerPasswordValidator and then you can get the request IP from the HttpContext.Request object.

查看更多
登录 后发表回答