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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
derekwilfong
Regular Visitor

Custom Data Connector - Installed Applications

I've been working through some of the Custom Data Connector examples posted on Github Data Connector Samples using OAuth 2.0. In my case I'm trying to connect to Procore for a installed application which requires a redirect of urn:ietf:wg:oauth:2.0:oob. The examples provided don't show how your return the authorization code from the browser title bar. I believe that where the example code calls for a query string parameter (parts = Uri.Parts(callback)[Query]...)  I need to retrieve the code that is in the title bar if that is possible. I appreciate any help. Thank you. 

 

StartLogin = (resourceUrl, state, display) =>
    let
        authorizeUrl = authorize_uri & "?" & Uri.BuildQueryString([
            client_id = client_id,
                        response_type = "code",
                        state = state,
                        redirect_uri = redirect_uri
            ])
 
    in
        [
        LoginUri = authorizeUrl,
        ////
        CallbackUri = redirect_uri,
        WindowHeight = 720,
        WindowWidth = 1024,
        Context = null
        ];

FinishLogin = (context, callbackUri, state) =>
    let
        // parse the full callbackUri, and extract the Query string
        parts = Uri.Parts(callbackUri)[Query],

        // if the query string contains an "error" field, raise an error
        // otherwise call TokenMethod to exchange our code for an access_token

        result = if (Record.HasFields(parts, {"error", "error_description"})) then 
                    error Error.Record(parts[error], parts[error_description], parts)
                 else
                    TokenMethod("authorization_code", parts[code])
                    //TokenMethod()
    in
        result;
        //TokenMethod(parts[code]);

Refresh = (resourceUrl, refresh_token) => TokenMethod("refresh_token", "refresh_token", refresh_token);

 

 

derekwilfong_0-1617839439144.png

 

1 REPLY 1
v-xulin-mstf
Community Support
Community Support

Hi @derekwilfong

 

You can create custom connectors in Power BI Service following the instructions in the article below. However, the custom connectors in Power BI Desktop and Power BI Service applies in different scenarios.
https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-content-pack-overview/
There is also a video about how to create custom connectors for Power BI Desktop and Power BI Service for your reference.
https://www.youtube.com/watch?v=Llh86eUqGXU

 

Best Regards,

Link

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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