Forum Discussion
Anonymous
6 years agoNot applicable
How to resolve thePower BI API token issue in the Azure Active Directory Federation Services ADFS ?
The code was working fine until we have setup the Power BI Single Sign-on (SSO). Now it throws token error. Has anyone solved this issue?
def token():
username,password = login() #get login
data = {
'grant_type': 'password',
'scope': 'openid',
'resource': 'https://analysis.windows.net/powerbi/api',
'client_id': '******',
'username': username,
'password': password
}
endpoint = 'https://login.microsoftonline.com/common/oauth2/token'
r = requests.post(endpoint, data=data)
data = r.json()
access_token = data['access_token']
headers = {'Content-Type': "application/json",
'Authorization': 'Bearer ' +access_token}
return headers
1 Reply
- JayendranSolution Sage
Hi Anonymous ,
Could you please provide the detailed error description?