我想将admin API与python的Power BI配合使用。
为此,我无法使用客户端ID和客户端密钥进行身份验证,但是我需要使用用户名和密码进行身份验证。这是我的代码:
import adal
import requests
username = 'XXX'
password = 'XXX'
client_id = 'XXX'
context = adal.AuthenticationContext(authority=authority_url, validate_authority=True, api_version=None)
token = context.acquire_token_with_username_password(resource=resource_url, username=username, password=password, client_id=client_id)
print(token.get('accessToken'))
错误消息是:
Access has been blocked by Conditional Access policies. The access policy does not allow token issuance
我与租户管理员进行了核对,他说我的请求的设备ID为空。有人可以帮忙吗?