以 asp.net 身份验证用户设备
Verify user device in asp.net identity
当 he/she 尝试使用他注册的设备登录时,我正在尝试验证用户的设备。
用户名、密码和 grant_type 使用 x-www-form-urlencoded
发送请求是
grant_type=password&username=user1&password=123&device_id=123456789
devise_id
已在客户端中捕获并随请求一起发送。我如何在服务器
上的 OAuthAuthorizationServerProvider
中读取 GrantResourceOwnerCredentials
方法中的 device_id
值
看起来除了在header中发送device_id
并像
一样阅读之外别无他法
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
{
String deviceId = context.OwinContext.Request.Headers.Get("device_id");
}
当 he/she 尝试使用他注册的设备登录时,我正在尝试验证用户的设备。
用户名、密码和 grant_type 使用 x-www-form-urlencoded
发送请求是
grant_type=password&username=user1&password=123&device_id=123456789
devise_id
已在客户端中捕获并随请求一起发送。我如何在服务器
OAuthAuthorizationServerProvider
中读取 GrantResourceOwnerCredentials
方法中的 device_id
值
看起来除了在header中发送device_id
并像
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
{
String deviceId = context.OwinContext.Request.Headers.Get("device_id");
}