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

Identityserver 4 和 Azure AD

Identityserver 4 and Azure AD(Identityserver 4 和 Azure AD)
本文介紹了Identityserver 4 和 Azure AD的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在研究在基于 C# 的 MVC 應用程序中使用 Identity Server 4 進行身份驗證.我想使用存儲在 Azure AD 中的帳戶作為有效用戶的來源,但文檔似乎只涉及 Google 和 OpenID &只是順便提到了 Azure.

I'm looking into using Identity Server 4 for authentication within a C# based MVC application. I'd like to use accounts stored in Azure AD as a source of valid users but the documentation only seems to refer to Google and OpenID & only mentions Azure in passing.

是否有人知道有關如何在將 Azure AD 與 Identity Server 4 一起使用的上下文中使用它的任何好的文檔和/或教程?

Does anybody know of any good documentation and/or tutorials on how to use Azure AD in the context of using it with Identity Server 4?

推薦答案

您可以使用從 IdentityServer 登錄到 Azure AD,就像從例如使用登錄到 IdentityServer 一樣.Javascript 或 MVC 應用程序.

You can use signin to Azure AD from IdentityServer just as you would use signin to IdentityServer from e.g. a Javascript or MVC app.

我最近已經這樣做了,你需要做的就是像這樣向 Azure Ad 注冊 OpenIdConnect 選項:

I have done this recently, and all you need to do is register OpenIdConnect options to Azure Ad like this:

public void ConfigureAuth(IAppBuilder app)
{
    app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

    app.UseCookieAuthentication(new CookieAuthenticationOptions());

    app.UseOpenIdConnectAuthentication(
        new OpenIdConnectAuthenticationOptions
        {
            ClientId = clientId,
            Authority = authority,
            PostLogoutRedirectUri = postLogoutRedirectUri,
        });
}

在此處了解更多信息:https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-webapp-dotnet

然后您應該在登錄操作中調用 ChallengeAsync 方法:

You should then in your Login action call the ChallengeAsync method:

var authenticationProperties = new AuthenticationProperties { RedirectUri = "your redirect uri" };
await HttpContext.Authentication.ChallengeAsync(your policy, authenticationProperties);

然后提供一個回調方法作為 GET 方法,然后遵循 IdentityServer 示例中提供的外部登錄示例:https://github.com/IdentityServer/IdentityServer4.Samples/blob/dev/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/QuickstartIdentityServer/Quickstart/Account/AccountController.cs

Then provide a callback method as a GET method then follow the External Login samples provided in IdentityServer samples: https://github.com/IdentityServer/IdentityServer4.Samples/blob/dev/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/QuickstartIdentityServer/Quickstart/Account/AccountController.cs

這篇關于Identityserver 4 和 Azure AD的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 令牌授權不起作用)
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屋-程序員軟件開發技
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
Getting access token using email address and app password from oauth2/token(使用電子郵件地址和應用程序密碼從 oauth2/token 獲取訪問令牌)
New Azure AD application doesn#39;t work until updated through management portal(新的 Azure AD 應用程序在通過管理門戶更新之前無法運行)
主站蜘蛛池模板: 欧美日韩亚洲综合 | 色综合久久天天综合网 | av免费在线播放 | 国产精品久久久久久久久 | 欧美一区在线视频 | 黑森林av| 色综合久久88色综合天天 | av九九 | 中文字幕伊人 | 日韩欧美专区 | 草草福利影院 | 视频一区在线观看 | 三级黄网站 | 国产视频三区 | 国产精品九九 | 色婷婷国产 | 特级淫片裸体免费看 | av免费观看在线 | 午夜网 | 国产激情视频在线观看 | 日韩欧美在线一区 | 久久国产综合 | 91精品国产综合久久久蜜臀 | 特大黑人巨交吊性xxxx视频 | 欧美专区在线观看 | 美女视频一区二区 | 一级做a视频 | 一区二区三区视频在线 | 国产成人精品三级麻豆 | 天天色影院 | 久久噜噜| 日韩免费在线观看视频 | www久久久久 | 久久久www成人免费精品 | 亚洲一区日韩 | 国产三级视频在线播放 | 欧美日韩国产成人 | 永久免费看mv网站入口亚洲 | 亚洲免费在线观看视频 | 日韩中文字幕精品 | www.婷婷.com|