久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

現有 Asp.Net 核心應用程序中缺少 Azure Active Direc

Authentication with Azure Active Directory connected services missing in existing Asp.Net core application(現有 Asp.Net 核心應用程序中缺少 Azure Active Directory 連接服務的身份驗證) - IT屋-程序員軟件開發技術分享
本文介紹了現有 Asp.Net 核心應用程序中缺少 Azure Active Directory 連接服務的身份驗證的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我有現有的 Asp.net core 2.0 應用程序.我正在嘗試向其添加使用 Azure Active Directory 連接服務的身份驗證.當我嘗試右鍵單擊連接的服務并檢查使用 Azure Active Directory 連接的服務進行身份驗證時,我沒有找到該選項.我在網上搜索,發現對于現有的 asp.net 核心應用程序,沒有連接服務選項.在這種情況下會有什么解決方法?有什么提示嗎?

I have existing Asp.net core 2.0 application. I am trying to add Authentication with Azure Active Directory connected service to it. When I tried to right click on connected services and checked for Authentication with Azure Active Directory connected service, I did not find the option. I searched online and found that for existing asp.net core applications there is not connected service option. What will be the work around in this case? any hints?

推薦答案

您可以嘗試以下步驟:

  1. 安裝包:Microsoft.AspNetCore.Authentication.AzureAD.UI

修改 Startup.cs 以啟用 Azure AD 身份驗證:

Modify the Startup.cs to enable Azure AD Authentication:

services.Configure<CookiePolicyOptions>(options =>
{
    // This lambda determines whether user consent for non-essential cookies is needed for a given request.
    options.CheckConsentNeeded = context => true;
    options.MinimumSameSitePolicy = SameSiteMode.None;
});

services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
    .AddAzureAD(options => Configuration.Bind("AzureAd", options));

services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

  • 將認證中間件添加到配置中:

  • Add the authentication middleware to Configure :

    app.UseAuthentication();
    

  • 修改 appsettings.json 以添加 Azure AD 應用設置

  • Modify the appsettings.json to add the Azure AD app settings

    {
    "AzureAd": {
        "Instance": "https://login.microsoftonline.com/",
        "Domain": "xxxxxxx.onmicrosoft.com",
        "TenantId": "xxxxxx-e83b-4099-93c2-8ae86358d05c",
        "ClientId": "xxxxxxxx-80c5-4bd4-ad6a-a967ea0066d6",
        "CallbackPath": "/signin-oidc"
    },
    "Logging": {
        "LogLevel": {
        "Default": "Warning"
        }
    },
    "AllowedHosts": "*"
    }
    

  • 另一種方法是手動配置 OpenId Connect Middlerware,您可以參考以下文章:

    Another way is to config the OpenId Connect Middlerware manually , you can refer to below article :

    https://joonasw.net/view/aspnet-core-2-azure-ad-authentication

    這篇關于現有 Asp.Net 核心應用程序中缺少 Azure Active Directory 連接服務的身份驗證的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

    【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

    相關文檔推薦

    ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進行身份驗證并跨請求保留自定義聲明)
    ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權不起作用)
    ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登錄使用角色)
    How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護進程或服務器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發技
    .Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問令牌以與 Microsoft Graph 一起使用)
    Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
    主站蜘蛛池模板: 亚洲一区二区三区免费视频 | 伊人久久一区二区 | 北条麻妃99精品青青久久主播 | 亚洲一区二区三区欧美 | 午夜电影福利 | 成人免费福利 | 欧美一区二区激情三区 | 亚洲小视频在线播放 | 伊人青青久久 | 日韩精品一区二区三区 | 日韩电影一区 | 成人不卡视频 | 久久不射网| 一区日韩 | 四虎永久免费地址 | 欧美精品一区三区 | 男人的天堂亚洲 | 一区二区在线不卡 | 久久久成人免费视频 | 青青草视频网站 | 久久久久亚洲 | 欧美日韩久久久久 | 久色网 | 2023亚洲天堂 | 精品免费av | 亚洲成人国产综合 | 日韩欧美精品 | 亚洲精品国产电影 | 一区二区三区欧美 | 亚洲人在线观看视频 | 久久精品综合网 | 国产精品日韩欧美一区二区三区 | 久久久婷| 久久久久国产精品一区三寸 | 欧美日韩视频在线第一区 | 91精品国产高清久久久久久久久 | 一区二区三区在线 | 欧 | 二区在线观看 | 九九九视频精品 | 亚洲国产免费 | 中国黄色在线视频 |