首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在asp net framework 4.5中使用多种身份验证方法

在asp net framework 4.5中使用多种身份验证方法
EN

Stack Overflow用户
提问于 2021-11-04 05:04:10
回答 1查看 82关注 0票数 0

我需要在我们现有的Azure MVC网站项目中添加ASP.NET active directory身份验证,但我需要使用表单身份验证方法。

我完成了本教程中的所有步骤:https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-asp-webapp

但由于某种原因,没有重定向到AD登录页面,搜索解决方案a请查看此内容:IAuthenticationManager.Challenge not calling ExternalLoginCallback

将身份验证模式设置为none并添加标记解决了重定向问题,但删除了以前的表单身份验证。

有没有办法在同一项目中使用表单身份验证和Azure AD?

EN

回答 1

Stack Overflow用户

发布于 2021-11-05 12:11:41

  • 使用单个用户帐户创建新应用程序。

安装此软件包: Microsoft.AspNetCore.Authentication.AzureAD.UI的

  • services.AddDbContext(options => options.UseSqlServer( options)).AddCookie();

`services.AddDefaultIdentity() .AddEntityFrameworkStores();services.AddAuthentication(sharedOptions => }).AddAzureAD(options => Configuration.Bind("AzureAd",sharedOptions

实例更新实例“appsettings.json”:{ "AzureAd":"https://login.microsoftonline.com/"

  • “域名”:"xxx.onmicrosoft.com","TenantId":"xxxxxx-xxxxx-4f08-b544-b1eb456f228d",

  • "ClientId":"xxxxx-xxxxx-4717-9821-e4f718fbece4","CallbackPath":"/signin-oidc",

"CookieSchemeName":"Identity.External“},

阅读有关here的更多信息。用于Azure AD authentication

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69834719

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档