Get OAuth ClientID and ClientSecret from User in Power Query custom connecter using M language

202 Views Asked by At

We have developed custom connector using M language in Power Query. This custom connector connects to third party API and gets data from API. Third party API is secure and requires OAuth authentication. We have implemented OAuth authentication in our custom connector using steps mentioned in below sample - https://github.com/microsoft/DataConnectors/blob/master/samples/Github/github.pq

It works fine. But what we want is to accept ClientID and Client Secret from user when (s)he connects to our connector. Currently it is hard coded in file in same solution. Is there any way to pass user entered client id and secret into OAuth method specified using below syntax into custom connector?

Authentication = [ OAuth = [ StartLogin = StartLogin, FinishLogin = FinishLogin, Label = Extension.LoadString("AuthenticationLabel") ] ]

I did not find anyway to pass user input into that StartLogin method. I also did not find any way to set and use Global variables.

0

There are 0 best solutions below