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

Identityserver 4 和 Azure AD

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

問題描述

限時送ChatGPT賬號..

我正在研究在基于 C# 的 MVC 應(yīng)用程序中使用 Identity Server 4 進(jìn)行身份驗證.我想使用存儲在 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.

是否有人知道有關(guān)如何在將 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 應(yīng)用程序.

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.

我最近已經(jīng)這樣做了,你需要做的就是像這樣向 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

然后您應(yīng)該在登錄操作中調(diào)用 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);

然后提供一個回調(diào)方法作為 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

這篇關(guān)于Identityserver 4 和 Azure AD的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進(jìn)行身份驗證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權(quán)不起作用)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護(hù)進(jìn)程或服務(wù)器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發(fā)技
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調(diào)用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
Getting access token using email address and app password from oauth2/token(使用電子郵件地址和應(yīng)用程序密碼從 oauth2/token 獲取訪問令牌)
New Azure AD application doesn#39;t work until updated through management portal(新的 Azure AD 應(yīng)用程序在通過管理門戶更新之前無法運(yùn)行)
主站蜘蛛池模板: 日韩精品在线观看免费 | 人和拘一级毛片c | 日韩在线免费视频 | 精品久久久久久久久久久久久久 | 成年人在线观看 | 91在线色视频 | 国产精品九九九 | 日韩视频免费看 | 青青草原综合久久大伊人精品 | 又黄又色 | 日本亚洲一区二区 | 日韩精品一区二区三区中文字幕 | 国产一区二区三区精品久久久 | 国产日韩久久 | 国产成人免费视频网站高清观看视频 | 国产精品乱码一二三区的特点 | 国产精品日韩一区 | 国产精品视频网 | 毛片a级毛片免费播放100 | 91精品国产一区二区三区动漫 | 另类专区亚洲 | 亚洲视频在线观看 | 成年人精品视频 | 精品一区二区在线观看 | 国产成人在线播放 | 一区二区在线 | 天堂久久天堂综合色 | 国产一区二区a | 中文字幕亚洲精品在线观看 | 鸳鸯谱在线观看高清 | 免费在线观看黄色av | 久久综合一区 | 国产午夜在线 | 欧美一区不卡 | 色综合视频| 日韩欧美在线精品 | 欧美日韩一卡二卡 | 久久99国产精品久久99果冻传媒 | 久久一及片 | 91中文 | 久久高清免费视频 |