62,243
社区成员




//passWord方式授权
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
{
var oAuthIdentity = new ClaimsIdentity(context.Options.AuthenticationType);
//Custom code for Match user
if (!UserService.Login(context.UserName, context.Password)) //判断用户名、密码是否正确
{
return;
}
oAuthIdentity.AddClaim(new Claim(ClaimTypes.Name, context.UserName));
context.Validated(oAuthIdentity);
}