久久久久久久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 應用程序在通過管理門戶更新之前無法運行)
主站蜘蛛池模板: 国产精品永久久久久 | 久久久久久免费精品一区二区三区 | 大学生a级毛片免费视频 | 97国产精品 | 亚洲 欧美 日韩 在线 | 中文字幕的av | 欧美一级做性受免费大片免费 | 成人av片在线观看 | 成年人黄色免费视频 | 亚洲精品视频免费 | 成人夜晚看av | 亚洲一区二区三区四区在线观看 | 一区二区三区四区日韩 | 狠狠婷婷综合久久久久久妖精 | 久草青青草 | 欧美一区二区三区大片 | 久久九九免费 | 亚洲国产一区二区视频 | 欧美一二区 | 免费观看一级毛片视频 | 在线观看中文字幕 | jizz在线看片 | 精品网 | 一区二区三区韩国 | 91精品在线播放 | 精品熟人一区二区三区四区 | 婷婷色国产偷v国产偷v小说 | 日韩视频一区二区 | 男女羞羞的网站 | 伊人久久综合影院 | 美女黄视频网站 | 午夜久草| 91精品国产高清一区二区三区 | 国产一区三区视频 | www亚洲精品 | 国产xxxx岁13xxxxhd | 日韩视频在线免费观看 | 中文字幕一区在线观看视频 | 草草视频在线观看 | 精品99在线 | 亚洲国产精品99久久久久久久久 |