简体   繁体   English

Azure 使用 .net 核心 3.1 中的 azure 活动目录(单租户)的广告身份验证和授权?

[英]Azure Ad authentication and authorization using azure active directory (single tenant) in .net core 3.1?

i am using jwt token authentication by sql using entity framework in my project which is working perfectly fine.我在我的项目中使用实体框架通过 sql 使用 jwt 令牌身份验证,效果非常好。 now we have to add Microsoft azureAD login in the project?现在我们必须在项目中添加 Microsoft azureAD 登录? QUESTION 1: we have two type of user 1st one is stored in sql and other are stored in azure and they are not same.问题 1:我们有两种类型的用户,第一种存储在 sql 中,另一种存储在 azure 中,它们不一样。

now we have to provide username and password login for sql user(This part completed using jwt token based login) and microsoft login for azure use?现在我们必须为 sql 用户提供用户名和密码登录(这部分使用基于 jwt 令牌的登录完成)和 azure 使用的微软登录?

when i use openidconnect to login with microsoft its not working in my project?当我使用 openidconnect 登录微软时,它在我的项目中不起作用?

services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
            .AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"));

its not working.它不工作。 what i actually want is to add both authentication like this.我真正想要的是像这样添加两个身份验证。

services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
            .AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"));
        services.AddJwtAuthentication(Configuration);

If you are having new non-Azure users, you will have to use B2C.如果您有新的非 Azure 用户,则必须使用 B2C。 Refer to An ASP.NET Core web app with Azure AD B2C请参阅ASP.NET 内核 web 应用程序与 Azure AD B2C

The above sample shows how to build an MVC web application that performs identity management with Azure AD B2C using the ASP.Net Core OpenID Connect middleware.上面的示例展示了如何使用 ASP.Net Core OpenID Connect 中间件通过 Azure AD B2C 构建 MVC web 应用程序来执行身份管理。 It assumes you have some familiarity with Azure AD B2C.它假设您熟悉 Azure AD B2C。 If you'd like to learn all that B2C has to offer, start with it's documentation at aka.ms/aadb2c.如果您想了解 B2C 提供的所有内容,请从位于 aka.ms/aadb2c 的文档开始。

The app is a basic web application that performs three functions: sign-in, sign-up, and sign-out.该应用程序是一个基本的 web 应用程序,它执行三个功能:登录、注册和注销。 It is intended to help get you started with Azure AD B2C in a ASP.NET Core application, giving you the necessary tools to execute Azure AD B2C policies & securely identify uses in your application.它旨在帮助您在 ASP.NET 核心应用程序中开始使用 Azure AD B2C,为您提供执行 Azure AD B2C 策略的必要工具,并在您的应用程序中安全地识别使用 AD B2C 策略。

If you also want to integrate Identity (SQL) in your code, refer Introduction to Identity on ASP.NET Core .如果您还想在代码中集成身份 (SQL),请参阅ASP.NET Core 上的身份简介

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .Net Core Azure AD单租户认证 - .Net Core Azure AD single tenant Authentication .Net Core Azure AD 身份验证失败,因为混合 Active Directory - .Net Core Azure AD authentication failes since Hybrid Active Directory ASP.NET Core 3.1 Azure AD 身份验证抛出 OptionsValidationException - ASP.NET Core 3.1 Azure AD Authentication throws OptionsValidationException Azure AD 身份验证与 ASP.Net Core 6 中的自定义授权 - Azure AD Authentication with Custom Authorization in ASP.Net Core 6 AcquireTokenByAuthorizationCode 在使用 ASP.NET MVC 使用 Azure Active Directory 的单租户应用程序中引发新异常 - AcquireTokenByAuthorizationCode throw new exception in single tenant application using ASP.NET MVC using Azure Active Directory 我们可以申请 ASP.NET Core 3.1 MVC Azure AD 认证使用 HTTP - Can we apply ASP.NET Core 3.1 MVC Azure AD authentication using HTTP Azure AD 未在 .NET Core 3.1 中进行身份验证 - Azure AD Not Authenticating in .NET Core 3.1 带有.Net Core的Azure Active Directory - Azure Active Directory with .Net Core Azure Active Directory -.Net Core 3 Web 应用程序 - 禁用 2 因素身份验证 - Azure Active Directory - .Net Core 3 Web Application - Disable 2 Factor Authentication Azure AD 多租户、.Net Core Web API 和 MSAL(Microsoft 身份验证库) - Azure AD Multi Tenant ,.Net Core Web API with MSAL(Microsoft Authentication Libary)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM