我有一个 ASP.NET Core 3.1 项目,如以下示例:在 WPF 桌面应用程序中使用 Microsoft 身份平台登录用户并调用 ASP.NET Core Web API。
我使用的是Identity web
1.0 版和 Azure AD,单租户应用程序。
我编辑了清单添加,appRoles
因为我只请求应用程序令牌,而不是用户令牌:
[... more json ...]
"appId": "<guid>",
"appRoles": [
{
"allowedMemberTypes": [
"Application"
],
"description": "Accesses the application.",
"displayName": "access_as_application",
"id": "<unique guid>",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "access_as_application"
}
],
"oauth2AllowUrlPathMatching": false,
[... more json ...]
Run Code Online (Sandbox Code Playgroud)
我还启用了idtyp
访问令牌声明,以指定这是一个应用程序令牌。:
[... more json ...]
"optionalClaims": {
"idToken": [],
"accessToken": [
{
"name": "idtyp",
"source": …
Run Code Online (Sandbox Code Playgroud) c# oauth-2.0 azure-active-directory asp.net-core microsoft-identity-platform
Disposable.Create需要一个Action
as参数。的Action
与Rx订阅被设置时被运行。
处置Rx订阅时,我想运行一些异步清理代码,但是async () =>
with的使用与Action
相同async void
,我希望避免使用。有关我为什么要避免这种情况的更多详细信息,请参见此处。
是否有可能创建类似a的东西Disposable.AsyncCreate
,Func<Task>
而不是接受Action
。如果是这样,我应该如何将其用作a的一部分CompositeDisposable
?
还是有其他用于处理异步处置的模式?
builder.Build()
升级到 Visual Studio 16.3.0 (Visual Studio for Mac 8.3.1805) 后,Autofac在以前有效的项目中执行以下操作时引发异常:
类型 'Autofac.Features.Indexed.KeyedServiceIndex'2' 未实现接口 'Autofac.Features.Indexed.IIndex'2'
在此版本的 Visual Studio(可能还有早期版本)中,iOS 是使用 Mono 6.4.0.198 编译的,我怀疑这可能是引入制动更改的原因。或者,链接器对于最新的工具链的行为有所不同。我只能说,这曾经有效,但现在不行了。
遵循这些准则还不够:跨平台和本机应用程序
c# ×2
asp.net-core ×1
async-await ×1
asynchronous ×1
autofac ×1
dispose ×1
ios ×1
linker ×1
microsoft-identity-platform ×1
oauth-2.0 ×1
xamarin ×1