我为互操作库创建了一个nuget包.使用此软件包时,Nuget会自动将"嵌入互操作类型"设置为"True".但是,在我的项目中,这应该是"假的".在Nuget中是否有办法表明互操作类型不会被嵌入?
我正在尝试将 Microsoft 配置为 Identityserver4 中的外部登录提供程序。我通过使用以下身份服务器的文档成功了AddMicrosoftAccount:
services.AddAuthentication().AddMicrosoftAccount(microsoftOptions =>
{
microsoftOptions.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
microsoftOptions.ClientId = configuration["MicrosoftLoginProvider:ClientId"];
microsoftOptions.ClientSecret = configuration["MicrosoftLoginProvider:ClientSecret"];
});
Run Code Online (Sandbox Code Playgroud)
然而,我没有运气让单点退出工作。该文档与 Microsoft 的文档一致,网址为https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/microsoft-logins?view=aspnetcore-5.0。
但是,如果按照说明在 Microsoft 开发人员门户 (portal.azure.com) 中创建应用程序,该门户上的示例代码会建议采用不同的方式。门户为我生成的示例应用程序(WebApp-OpenIDConnect-DotNet)正在使用AddMicrosoftIdentityWebApp:
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"));
Run Code Online (Sandbox Code Playgroud)
由于该应用程序是开箱即用的,包括单点注销,我想知道这是否是我必须继续的方式。
然而,令我惊讶的是,我找不到任何有关如何在 IdentityServer4 中集成此方法的文档/博客。我自己几乎可以正常工作,但有一些奇怪的问题。
有人可以澄清使用是否AddMicrosoftIdentityWebApp是将 Microsoft 作为外部身份提供商添加到 Identityserver4 的方法吗?有人成功使用AddMicrosoftIdentityWebAppIdentityServer4 吗?
感谢您的帮助!
azure-active-directory openid-connect asp.net-core identityserver4