如果要使用OAuth 2.0资源所有者密码凭据授权(aka password),则需要实现并注册IResourceOwnerPasswordValidator接口:

public interface IResourceOwnerPasswordValidator
{
/// <summary>
/// Validates the resource owner password credential
/// </summary>
/// <param name="context">The context.</param>
Task ValidateAsync(ResourceOwnerPasswordValidationContext context);
}

在上下文中,您将找到已解析的协议参数,如UserName和Password,以及原始请求,如果您想查看其他输入数据。

然后,您的工作是实施密码验证并相应地设置Result上下文。请参阅GrantValidationResult文档。

github地址

第37章 资源所有者密码验证(Resource Owner Password Validation) - Identity Server 4 中文文档(v1.0.0)的更多相关文章

  1. 第13章 切换到混合流并添加API访问 - Identity Server 4 中文文档(v1.0.0)

    在之前的快速入门中,我们探讨了API访问和用户身份验证.现在我们想把这两个部分放在一起. OpenID Connect和OAuth 2.0组合的优点在于,您可以使用单个协议和使用令牌服务进行单次交换来 ...

  2. 第65章 博客帖子 - Identity Server 4 中文文档(v1.0.0)

    第65章 博客帖子 65.1 团队帖子 65.1.1 2019 IdentityServer中的范围和声明设计 尝试使用IdentityServer4的设备流程 OAuth2中隐含流的状态 另一种保护 ...

  3. 第34章 授予类型 - Identity Server 4 中文文档(v1.0.0)

    授权类型是指定客户端如何与IdentityServer交互的方式.OpenID Connect和OAuth2.0规范定义了以下授权类型: Implicit Authorization code Hyb ...

  4. 第10章 使用密码保护API - Identity Server 4 中文文档(v1.0.0)

    OAuth 2.0资源所有者密码授权允许客户端向令牌服务发送用户名和密码,并获取代表该用户的访问令牌. 除了无法承载浏览器的旧应用程序之外,规范通常建议不要使用资源所有者密码授予.一般来说,当您要对用 ...

  5. 第57章 GrantValidationResult - Identity Server 4 中文文档(v1.0.0)

    该GrantValidationResult类模型补助确认为扩展授权和资源所有者密码授权的结果. 最常见的用法是使用身份验证(成功用例): context.Result = new GrantVali ...

  6. 第49章 令牌端点(Token Endpoint) - Identity Server 4 中文文档(v1.0.0)

    令牌端点可用于以编程方式请求令牌.它支持password,authorization_code,client_credentials,refresh_token和urn:ietf:params:oau ...

  7. 第38章 刷新令牌 - Identity Server 4 中文文档(v1.0.0)

    第38章 刷新令牌 由于访问令牌的生命周期有限,因此刷新令牌允许在没有用户交互的情况下请求新的访问令牌. 以下流程支持刷新令牌:授权代码,混合和资源所有者密码凭据流.需要明确授权客户端通过设置Allo ...

  8. 第18章 启动 - Identity Server 4 中文文档(v1.0.0)

    IdentityServer是中间件和服务的组合.所有配置都在您的启动类中完成. 18.1 配置服务 您可以通过调用以下方法将IdentityServer服务添加到DI系统: public void ...

  9. 第16章 使用ASP.NET Core Identity - Identity Server 4 中文文档(v1.0.0)

    注意 对于任何先决条件(例如模板),首先要查看概述. IdentityServer旨在提供灵活性,其中一部分允许您为用户及其数据(包括账户密码)使用所需的任何数据库.如果您从新的用户数据库开始,那么A ...

随机推荐

  1. HBase MVCC 机制介绍

    关键词:MVCC HBase 一致性 本文最好结合源码进行阅读 什么是MVCC ? MVCC(MultiVersionConsistencyControl , 多版本控制协议),是一种通过数据的多版本 ...

  2. gridlayout代码注释

    <div class="wrapper"> //定义一节或者一部分区域,它的css样式对应的css中class选择器的wrapper <div class=&qu ...

  3. 数据安全存放,全民搭建kodexplorer私有云存储

    数据安全存放可以说越来的重要,新闻上也经常报道出关于个人信息泄露的事件,不仅泄露,还有一些进行个人隐私买卖,之前报道出facebook便是如此.数字信息存放好比存钱一样,存在别人那里总会不放心.不如自 ...

  4. 编译的时候出现 usr/bin/ld: cannot find -lxxx 的错误

    比如错误为: usr/bin/ld: cannot find -labc 首先要明白的是 labc 代表的是 libabc.so 明白了这个之后,我们就知道了问题是:在编译的过程中,需要 libabc ...

  5. TCPDF说明文档

    TCPDF说明文档 一.首先调用TCPDF文件 require_once('tcpdf.php'); 二.实例化TCPDF类 页面方向(P =肖像,L =景观).测量(mm).页面格式 $pdf = ...

  6. B4 and After: Managing Hierarchy, Partitioning, and Asymmetry for Availability and Scale in Google’s Sofware-Defined WAN

    B4及之后:为谷歌软件定义WAN的可用性和扩展管理层次化.划分和不对称 本文为SIGCOMM 2018会议论文,由谷歌提供. 笔者翻译了该论文.由于时间仓促,且笔者英文能力有限,错误之处在所难免:欢迎 ...

  7. 基本类型数据转换(int,char,byte)

    public class DataUtil { public static void main(String[] args) { int a = 8; int value = charToInt(by ...

  8. [Swift]LeetCode10. 正则表达式匹配 | Regular Expression Matching

    Given an input string (s) and a pattern (p), implement regular expression matching with support for  ...

  9. [Swift]LeetCode637. 二叉树的层平均值 | Average of Levels in Binary Tree

    Given a non-empty binary tree, return the average value of the nodes on each level in the form of an ...

  10. [Swift]LeetCode877. 石子游戏 | Stone Game

    Alex and Lee play a game with piles of stones.  There are an even number of piles arranged in a row, ...