DataConnectors icon indicating copy to clipboard operation
DataConnectors copied to clipboard

multiple instances of the same connector need to authenticate one by one

Open OneCyrus opened this issue 5 years ago • 6 comments

we have a data connector which connects to our graphql API. the authentication is done by our own OAuth2 identity provider. the overall solution is working so far. currently we are fetching the data with Web.Contents where we have a full query to the data. but as we add multiple single queries to the reports (multiple times our data connector) we need to reauthenticate every instance individually every time our session is expired. this gets a really bad UX for the user.

so my questions are:

  • is there a way to authenticate a data connector globally?
  • is there a better way to customize the query to our data source than the argument to our contents function?
[DataSource.Kind="GIA.Integration.PowerBI", Publish="GIA.Integration.PowerBI.Publish"]
shared GIA.Integration.PowerBI.Contents = (Url as text) =>
    let
        reponse =  Web.Contents(Url),
        body = Json.Document(reponse)
    in
        body;

GIA.Integration.PowerBI = [
    Authentication = [
		OAuth = [
			    StartLogin=StartLogin,
                            FinishLogin=FinishLogin,
                            Refresh=Refresh,
                            Logout=Logout
	        ]
    ],
    TestConnection = (dataSourcePath) => {"GIA.Integration.PowerBI.Contents", dataSourcePath},
    Label = Extension.LoadString("DataSourceLabel")
];

OneCyrus avatar May 31 '19 07:05 OneCyrus