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

添加 Azure Ad Oauth2 JWT 令牌聲明

Adding Azure Ad Oauth2 JWT Token Claims(添加 Azure Ad Oauth2 JWT 令牌聲明)
本文介紹了添加 Azure Ad Oauth2 JWT 令牌聲明的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我只是想知道是否可以通過 Azure 門戶向 Azure Ad OAuth2 JWT 令牌添加或指定自定義聲明?還是這只是可能的代碼方面?

I was just wondering if there is a way to add or specify custom claims to the Azure Ad OAuth2 JWT token via Azure Portal? Or is this only possible code side?

推薦答案

據我所知,Azure AD目前不支持發出自定義聲明.

As far as I know, the Azure AD doesn't support to issue the custom claim at present.

作為一種解決方法,我們可以使用 Azure AD Graph 添加 目錄架構擴展.之后,我們可以使用 Azure AD Graph 獲取數據擴展,并在驗證安全令牌時添加自定義聲明,如下代碼所示:

As a workaround, we can use the Azure AD Graph to add the directory schema extensions. After that, we can use the Azure AD Graph to get the data extension and add the custom claim when the security token is verified like code below:

app.UseOpenIdConnectAuthentication(
    new OpenIdConnectAuthenticationOptions
    {
        ClientId = clientId,
        Authority = authority,
        PostLogoutRedirectUri = postLogoutRedirectUri,
        Notifications = new OpenIdConnectAuthenticationNotifications
        {
            AuthenticationFailed = context => 
            {
                context.HandleResponse();
                context.Response.Redirect("/Error?message=" + context.Exception.Message);
                return Task.FromResult(0);
            }
            ,
            SecurityTokenValidated = context =>
            {
                //you can use the Azure AD Graph to read the custom data extension here and add it to the claims 
                context.AuthenticationTicket.Identity.AddClaim(new System.Security.Claims.Claim("AddByMe", "test"));
                return Task.FromResult(0);
            }
    });

此外,如果您對 Azure 有任何想法或反饋,可以從 這里.

In addition if you have any idea or feedback about Azure, you can submit them from here.

這篇關于添加 Azure Ad Oauth2 JWT 令牌聲明的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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一区二区三区在线观看 | 五月婷婷亚洲 | 亚洲福利一区 | 亚洲色网址 | 午夜精品999 | 日本不卡一区 | 国产又黄又爽视频 | 夜晚福利视频 | 成人网av | 亚洲91av| 欧美一区二区在线视频 | 蜜臀久久99精品久久久久久宅男 | 日韩免费看片 | 日韩在线免费播放 | 精品国产视频 | 国内精品一区二区三区 | 在线观看黄色av | 干干干操操操 | 日本丰满少妇裸体自慰 | 亚洲午夜久久 | 国内av在线| 91久久久久久久久 | 欧美一级在线 | 97在线看| 国产黄色精品 | 四虎影院免费观看 | 欧美国产一区二区 | 精品久久久久久久久久久久久 | 免费欧美视频 | 精品综合网 | 日韩免费小视频 | 国产视频一区二区三区四区 | 午夜精品国产精品大乳美女 | 十八岁毛片 | 午夜视频在线播放 | 亚洲性视频 | 精品1区2区3区 | 黄色影院在线观看 | 亚洲一级黄色片 | 五月婷婷网站 |