如何在声明中包含电子邮件并通过API控制器获取电子邮件值?
IdentityServer4示例:https://github.com/IdentityServer/IdentityServer4.Samples/tree/release/Quickstarts/8_EntityFrameworkStorage
API IdentityController https://github.com/IdentityServer/IdentityServer4.Samples/blob/release/Quickstarts/8_EntityFrameworkStorage/src/Api/Controllers/IdentityController.cs
1 回答
定义api资源(看看Config.cs)时,可以这样做:
它定义了您的API将接收这些声明 .
编辑:
如果将关联资源添加到GetIdentityResources函数中会更好(请参阅Config.cs)
在官方文档中浏览一下以获得更好的图片http://docs.identityserver.io/en/release/topics/resources.html .
我从个人项目中给出了一个完整的例子: