Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
Hi @Anonymous ,
Could you please provide the detailed error description?