- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
如何在声明中包含电子邮件并通过 API Controller 获取电子邮件值?
IdentityServer4 示例:https://github.com/IdentityServer/IdentityServer4.Samples/tree/release/Quickstarts/8_EntityFrameworkStorage
API 身份 Controller https://github.com/IdentityServer/IdentityServer4.Samples/blob/release/Quickstarts/8_EntityFrameworkStorage/src/Api/Controllers/IdentityController.cs
最佳答案
当您定义一个 api 资源(查看 Config.cs)时,您可以这样做:
new ApiResource
{
Name = "api",
DisplayName = "My API",
UserClaims =
{
JwtClaimTypes.Id,
JwtClaimTypes.Subject,
JwtClaimTypes.Email
}
}
它定义您的 API 将接收这些声明。
编辑:
最好将关联资源添加到 GetIdentityResources 函数(请参阅 Config.cs)
浏览一下官方文档以获得更好的图片 http://docs.identityserver.io/en/release/topics/resources.html .
我给你一个来自个人项目的完整例子:
public static IEnumerable<IdentityResource> GetIdentityResources()
{
//>Declaration
var lIdentityResources = new List<IdentityResource>
{
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
new IdentityResources.Email()
};
//>Processing
foreach (var lAPIResource in GetApiResources())
{
lIdentityResources.Add(new IdentityResource(lAPIResource.Name,
lAPIResource.UserClaims));
}
//>Return
return lIdentityResources;
}
public static IEnumerable<ApiResource> GetApiResources()
{
return new List<ApiResource>
{
new ApiResource
{
Name = "api1",
DisplayName = "api1 API",
UserClaims =
{
JwtClaimTypes.Id,
JwtClaimTypes.Subject,
JwtClaimTypes.Email
}
}
};
}
关于c# - 身份服务器 4 : How so you include additional claims and get the value in an API controller?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44537222/
作为一个小项目(没有什么关键任务),我决定尝试用 C# 编写 GOST 28147-89 的实现。但是,在阅读 RFC 5830 时(定义 GOST 28147-89 的信息),我注意到了这一点。 (
我在 Android JNI 上使用 Neon 实现了一个算法。当我想将向量相加时,我注意到有两种类型的方法,但我看不出其中的区别。 // pairwise addition int8x8_t vpa
我想知道为什么 STL 没有重载它们的算法函数,这样我就可以通过简单地提供一个容器而不是采用更冗长的方式来传递开始 + 结束迭代器来调用它们。我当然理解为什么我们还想使用迭代器对来处理容器/数组的子序
我想知道为什么 STL 不会重载它们的算法函数,这样我就可以通过简单地提供一个容器而不是采用更冗长的方式来传递 begin + end 迭代器来调用它们。我当然理解为什么我们还想使用迭代器对来处理容器
假设我有两个模块 - Module1、Module2。 每个模块在 Visual Studio 中都有自己的项目。 如何使用“附加模块依赖项”或“附加 BMI 目录”设置将模块 2 导入模块 1? 问
我有一个问题 df = data.frame(col1 = c("A", "B", "C", "A", "A", "B"), col2 = c(0.2, 0.2, 0.6, 1, 0.8, 0.2),
在sencha touch中,我有一个如下声明的轮播: ajaxNav = new Ext.Panel({ scroll: 'vertical', cls: 'card1 dem
我有一个开始日期,如下所示: var beginDate = "29/04/2015"; var beginHour = "13:32"; 我有一些持续时间变量: var hourDuration =
我一直在以一种相当粗糙的函数式方式进行一些动态系统模拟,目前正试图弄清楚 cpp 对象可以为我的代码带来什么。更具体地说,我在考虑以下结构: 我想通过一个抽象类来指定动力系统,比如“DynSys”,用
我想知道是否有办法强制将图像加载为 8U。我在 OpenCV 文档中看到您可以指定是将图像加载为单 channel 还是三 channel ,但没有提及颜色深度。有什么建议吗? 感谢您的帮助!!! :
题目地址:https://leetcode.com/problems/additive-number/description/ 题目描述: Additive number is a string
我已经使用 react-leaflet 有一段时间了,几周后我删除了 node_modules 中的文件并重新安装了它们,我根本没有接触 react-leaflet 版本,但是当我尝试运行时该项目,它
令我惊讶的是,我发现在 TCanvas 上重复渲染文本在某种程度上是“附加的”。我意识到设置 Canvas.Brush.Style:=bsClear 是问题的原因,但我确实需要透明且重复地渲染文本(即
我有一个 pdf 文件,其中包含“UniCNS-UCS2-H”字体,我尝试了 pdfbox 和 pdfrenderer,它们都抛出异常:“UniCNS-UCS2-H”的未知编码 这个字体包含在一个字体
我有一个大多数用户只会使用一次的 Facebook 应用程序。在进入 Facebook 工作流程之前,用户表明他们是否希望自己的墙被写入。基于此,我要么请求 publish_stream 许可,要么不
我正在尝试使用 CodeIgnitor 在 php、mysql 中制作标记表。我已经使用XAMPP并创建了一个数据库。用于存储每条记录。正在从数据库中检索数据,插入的新记录已成功编辑 但问题在于检索总
是否可以为 AppStore 应用审核提供额外的文件? 我们正在开发一个与 SAP 服务器通信的应用程序。为了审查该应用程序,我们设置了一个可供 Apple 访问的测试服务器。但是该服务器上的证书是自
enter image description here 我正在尝试设置我的函数并执行一些重载操作,以便我可以 +、-、==、* 两个矩阵。我在第一次操作重载时遇到了一个问题:加法。 我的程序一直有效
我正在尝试制作一个可以执行各种算术函数的基本计算器,从加法开始!现在我已经弄清楚了它的基本逻辑,但我不确定如何获取两个输入并将其打印出来! #include int main() { cha
这个问题在这里已经有了答案: Showing a Windows form on a secondary monitor? (9 个回答) 关闭 9 年前。 我有一个应用程序,其中有一个我想在第二个
我是一名优秀的程序员,十分优秀!