Azure active directory Azure广告没有';不允许脱机访问

Azure active directory Azure广告没有';不允许脱机访问,azure-active-directory,Azure Active Directory,我正在尝试使用Azure AD将用户登录到我的应用程序,但我无法在我的服务器上获得脱机访问权限(范围) 我的初步要求是: https://login.microsoftonline.com/{tenant}/oauth2/authorize?client_id={client_id}&response_type=code&redirect_uri=https%3A%2F%2Fservice%2Emyserver%2Ecz&scope=user.read%20openid%

我正在尝试使用Azure AD将用户登录到我的应用程序,但我无法在我的服务器上获得脱机访问权限(范围)

我的初步要求是:

https://login.microsoftonline.com/{tenant}/oauth2/authorize?client_id={client_id}&response_type=code&redirect_uri=https%3A%2F%2Fservice%2Emyserver%2Ecz&scope=user.read%20openid%20profile%20offline_access&response_mode=form_post&state=azure_login
正如您所看到的,我请求
用户。阅读
openid
配置文件
脱机访问
。但当我得到令牌时,响应是:

{
    "token_type": "Bearer",
    "scope": "profile openid email User.Read",
    "expires_in": 3599,
    "ext_expires_in": 3599,
    "access_token": "ey...",
    "id_token": "ey..."
}
首先,我没有要求发送电子邮件,其次,没有
refresh\u token
expires\u on

最有趣的是,如果我在我的计算机上本地运行应用程序(redirect_uri是),我会得到完全不同的响应:

{
    "token_type": "Bearer",
    "expires_in": "3599",
    "ext_expires_in": "3599",
    "expires_on": "1568980038",
    "access_token": "AQ...",
    "refresh_token": "AQ...",
    "id_token": "ey..."
}
本地我有
脱机访问权限
权限,另一方面我没有任何其他权限。例如,我无法访问
https://graph.microsoft.com/v1.0/me
来自


要在我的服务器上获得脱机访问权限,我必须做什么?

好的,我终于找到了。整个问题都是由API的组合引起的。有以下链接:

https://login.microsoftonline.com/{tenant}/oauth2/authorize
https://login.microsoftonline.com/{tenant}/oauth2/token
https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize
https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
我忽略了“v2.0”,将它们混合在一起