亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法使用 adal4j Api 獲取 Azure 令牌

無法使用 adal4j Api 獲取 Azure 令牌

大話西游666 2021-09-12 20:00:25
我正在嘗試從 Microsoft 圖形中讀取用戶配置文件/圖像,并且正在使用 adal4j-1.5.0.jar 生成 azure 令牌,以便基于令牌我可以調用圖形 API/Microsoft delve。我在下面的代碼中遇到問題。在不生成令牌或任何異常的情況下,在下面的行之后移動到 finally 塊很簡單?!拔磥砦磥?= context.acquireToken(resourceUri, credential, null);”String clientId = "clientid";String clientSecret = "cleintsecret";String resourceUri = "https://graph.microsoft.com/v1.0/me";String redirectUri = "http://localhost:9082/contextroot";String authorityUri ="https://login.microsoftonline.com/{tenent id}/oauth2/authorize";AuthenticationContext context = null;AuthenticationResult result = null;ExecutorService service = null;try {    service = Executors.newFixedThreadPool(1);    context = new AuthenticationContext(authorityUri, false, service);    ClientCredential credential = new ClientCredential(clientId,clientSecret);    Future<AuthenticationResult> future = context.acquireToken(resourceUri, credential, null);    result = future.get();}finally {    service.shutdown();}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 224 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號