AcquisitionTokenAsync的问题-缺少访问令牌的设备ID [英] Issue with acquireTokenAsync - access token missing deviceid

查看:208
本文介绍了AcquisitionTokenAsync的问题-缺少访问令牌的设备ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,称为acquireTokenAsync.从acquiredTokenAsync调用生成的令牌出现",并在步骤3中显示.是有效的,但是当我在https://login.microsoftonline.com/**********/oauth2/token上发布帖子(帖子在我的快速中间件中发生)时, 我收到以下错误消息. userId应该是可选的.

注意:我正在使用带有代理身份验证集的Microsoft Intune.

#错误:AADSTS5300需要管理您的设备才能访问此资源.

任何人都对避免使用userId可选参数时为什么会发生这种情况有任何想法?如果包含userId
,我不会收到此错误消息
这是我在/oauth2/token端点的帖子中使用的配置对象.

        grant_type:'urn:ietf:params:oauth:grant-type:jwt-bearer',
        client_id:********,
        client_secret:*******
     断言:******
        requested_token_use:'on_behalf_of',
       资源:"https://graph.microsoft.com/",
        scope:"openid电子邮件offline_access用户.读取日历.读取日历.ReadWrite日历.ReadWrite.Shared"
这是我的环境配置cli软件包:(/usr/local/lib/node_modules)

发行环境
@ ionic/cli-utils:1.19.2
ionic(Ionic CLI):3.20.0
全局软件包:

cordova(Cordova CLI):8.0.0
本地包:

@ ionic/app-scripts:3.1.9
Cordova平台:android 7.1.0 ios 4.5.4
离子框架:离子角3.9.2
系统:

Android SDK工具:26.1.1
ios-deploy:1.9.2
节点:v8.11.1
npm:5.6.0
操作系统:macOS High Sierra
Xcode:Xcode 9.3 Build 9E145

I'm running into an issue calling acquireTokenAsync. The generated token from the acquireTokenAsync call "appears" to be valid, but when I run a post (post is happening in my express middleware) to https://login.microsoftonline.com/**********/oauth2/token, I get the error message below. The userId should be optional.

Note: I am using Microsoft Intune with broker authentication set.

# error : AADSTS5300 "your device is required to be managed to access this resource.

Anyone have any ideas why this is happening when I avoid using the userId optional parameter? I don't get this error message if I include the userId

Here is the configuration object I use in the post to the /oauth2/token endpoint.

       grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
       client_id: ********,
       client_secret:*******
       assertion: ******
       requested_token_use: 'on_behalf_of',
       resource: ‘https://graph.microsoft.com/’,
       scope: 'openid email offline_access User.Read Calendars.Read Calendars.ReadWrite Calendars.ReadWrite.Shared'
Here is my environment configuration cli packages: (/usr/local/lib/node_modules)

Issue Environment
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:

cordova (Cordova CLI) : 8.0.0
local packages:

@ionic/app-scripts : 3.1.9
Cordova Platforms : android 7.1.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:

Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
Node : v8.11.1
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145

推荐答案

您可以查看此讨论链接-

You could check this discussion link - https://stackoverflow.com/questions/50845788/acquiretokenasync-missing-deviceid-in-the-token and see if this helps solving your issue.

--------------------------------------------------- -------------------------------------------------- ----------------------------------
如果此答案有帮助,请单击"标记为答案",然后单击投票.要提供有关您的论坛体验的其他反馈,请单击 这里 

-----------------------------------------------------------------------------------------------------------------------------------
If this answer was helpful, click "Mark as Answer" and Up-Vote. To provide additional feedback on your forum experience, click here 


这篇关于AcquisitionTokenAsync的问题-缺少访问令牌的设备ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆