久久久久久久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 應用程序在通過管理門戶更新之前無法運行)
主站蜘蛛池模板: 色综合天天网 | 中文在线一区二区 | 91久久精品国产91久久性色tv | 日本不卡一二三 | 久久一 | 日本 欧美 国产 | 久久午夜精品福利一区二区 | 日韩在线中文字幕 | 国产精品一区二区视频 | 国产一区在线免费观看视频 | 国产一区二区三区免费 | 免费网站国产 | 一区二区三区av | 日韩www | 99精品久久 | 国产精品久久久久一区二区三区 | 日韩电影在线一区 | 天天操夜夜艹 | 亚洲精品一区二区在线观看 | 欧美日韩在线免费观看 | www日韩欧美 | 日韩成人在线观看 | 午夜性视频 | 欧美aaa一级片 | 九九热在线视频观看这里只有精品 | 看av片网站 | 欧美成人黄色小说 | 黄色成人免费看 | 羞羞的视频免费在线观看 | 国产羞羞视频在线观看 | 国产成人精品a视频 | 免费看色 | 成人免费网站www网站高清 | 99精品网| 成人一区二区视频 | 人人做人人澡人人爽欧美 | 一级大黄色片 | 欧美一区二区三区在线观看视频 | 美女久久 | 亚洲精品99 | a黄视频|