Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not 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 1
Jayendran
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Could you please provide the detailed error description?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Kudoed Authors