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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Store access token custom connector

Hi, I am developing a custom connector for retrieving data from an API. The authentication flow was customized, therefore it does not follow a strict standard.

 

The flow is:

1. Ask user for Username and Password

2. API authenticate that user and then it returns an access_token with expiration time.

3. For retrieving data, the access_token must be sent.

 

So, my question is: Is there a way to store that access_token globally as Username and Password are stored in "Extension.CurrentCredential()"?

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Do you connect to data with Power BI Desktop via custom connector?

Or do you embed the Power BI Content into your apps?

 

If you are in first scenario,

when you connect to data, you need to provide the specific credential to retrieve data from the data source.

Does the flow you write above fit for you(report creator) or any users who consume your report?

 

If you are in the second scenario, please read official documents.

Step 2: Get n authentication access token

 

Best Regards

Maggie

 

Anonymous
Not applicable

I connect to data with custom connector.

In the definition of connector, I specified UsernamePassword as my method of authentication. The OAuth flow provided by PowerBI does not fit with my flow, for that reason I defined UsernamePassword as authentication.

 

So, is possible to store that access_token with UsernamePassword authentication?

No. If you've defined the authentication kind as UsernamePassword, then the only fields available to the Extension.CurrentCredential() record are UserName and Password. The access_token field is only available to the record if the authentication kind is OAuth.

 

What kind of OAuth grant type does your API require? Custom connectors should be able to handle the Authorization Code, Implicit, and Client Credentials grant types. Does your API use another grant type?

Anonymous
Not applicable

Client credentials, but I don't want that PowerBI redirect to a another page to sign in.

is there an example for that kind of grant type?

 

Thanks 

I've never done that nor have I seen it implemented. If you search for the terms client_credentials and grant_type on GitHub, you get two hits: one is from my repo where I authenticate to Twitter (not a custom connector) and the other is a repo for a custom connector that authenticates to Microsoft Teams. I don't know if that works, but I would try adapting that for my purposes.

 

Good luck!

 

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors