1

I am looking create a Power BI Custom Dataconnector that will allow authentication by capturing username, password and then calling webapi to authenticate the user. I have tried the example from

https://github.com/Microsoft/DataConnectors/tree/master/samples/HelloWorld

Which a very basic hello world example without UI to capture credentials. I like to know how to popup a "view" to capture the login details.

Community
  • 1
  • 1
mehwish
  • 199
  • 3
  • 15

1 Answers1

0

The MyGraph sample shows how to perform authentication using OAuth, which is next to basic authentication the only default methods supported.

Basically it comes down in providing an OAuth section in the data source definition:

MyGraph = [
    Authentication = [
        OAuth = [
            StartLogin=StartLogin,
            FinishLogin=FinishLogin,
            Refresh=Refresh,
            Logout=Logout
        ]
    ],
    Label = "My Graph Connector"
];

Note you need methods to perform the actual authentication and token exchange, as described in that sample.

Note that according to the OAuth spec, you should not let the client secret reside on the client, which is often done in these samples. You open up for serious vulnerabilities if you do so, so please be advised.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325