<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom connector : pass UI values to StartLogin function in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-pass-UI-values-to-StartLogin-function/m-p/2211298#M33194</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/298087"&gt;@ochaoui&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create a Data Source definition&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//
// Data Source definition
//
GithubSample = [
    Authentication = [
        OAuth = [
            StartLogin = StartLogin,
            FinishLogin = FinishLogin
        ]
    ],
    Label = Extension.LoadString("DataSourceLabel")
];&lt;/LI-CODE&gt;
&lt;P&gt;2.&amp;nbsp;Provide details so the M engine can start the OAuth flow.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The following code snippet describes how to implement a&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;StartLogin&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;function to start the login flow.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;StartLogin = (resourceUrl, state, display) =&amp;gt;
        let
            AuthorizeUrl = "https://github.com/login/oauth/authorize?" &amp;amp; Uri.BuildQueryString([
                client_id = client_id,
                scope = "user, repo",
                state = state,
                redirect_uri = redirect_uri])
        in
            [
                LoginUri = AuthorizeUrl,
                CallbackUri = redirect_uri,
                WindowHeight = windowHeight,
                WindowWidth = windowWidth,
                Context = null
            ];&lt;/LI-CODE&gt;
&lt;P&gt;For more details you may refer to this offical blog:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-query/samples/github/readme" target="_self"&gt;GitHub Connector Sample&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 06:11:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-11-29T06:11:50Z</dc:date>
    <item>
      <title>Custom connector : pass UI values to StartLogin function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-pass-UI-values-to-StartLogin-function/m-p/2206048#M33113</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am developing a custom connector where the user write down on the UI :&lt;/P&gt;&lt;P&gt;- the API URL&lt;/P&gt;&lt;P&gt;- the client_id&lt;/P&gt;&lt;P&gt;-the client_secret&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ochaoui_0-1637765484023.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/635626iF84344F2CF5B8A6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ochaoui_0-1637765484023.png" alt="ochaoui_0-1637765484023.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how to pass the client_id and client_secret to my&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;StartLogin and&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FinishLogin ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 14:52:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-pass-UI-values-to-StartLogin-function/m-p/2206048#M33113</guid>
      <dc:creator>ochaoui</dc:creator>
      <dc:date>2021-11-24T14:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Custom connector : pass UI values to StartLogin function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-pass-UI-values-to-StartLogin-function/m-p/2211298#M33194</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/298087"&gt;@ochaoui&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create a Data Source definition&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//
// Data Source definition
//
GithubSample = [
    Authentication = [
        OAuth = [
            StartLogin = StartLogin,
            FinishLogin = FinishLogin
        ]
    ],
    Label = Extension.LoadString("DataSourceLabel")
];&lt;/LI-CODE&gt;
&lt;P&gt;2.&amp;nbsp;Provide details so the M engine can start the OAuth flow.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The following code snippet describes how to implement a&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;StartLogin&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;function to start the login flow.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;StartLogin = (resourceUrl, state, display) =&amp;gt;
        let
            AuthorizeUrl = "https://github.com/login/oauth/authorize?" &amp;amp; Uri.BuildQueryString([
                client_id = client_id,
                scope = "user, repo",
                state = state,
                redirect_uri = redirect_uri])
        in
            [
                LoginUri = AuthorizeUrl,
                CallbackUri = redirect_uri,
                WindowHeight = windowHeight,
                WindowWidth = windowWidth,
                Context = null
            ];&lt;/LI-CODE&gt;
&lt;P&gt;For more details you may refer to this offical blog:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-query/samples/github/readme" target="_self"&gt;GitHub Connector Sample&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 06:11:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-pass-UI-values-to-StartLogin-function/m-p/2211298#M33194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T06:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Custom connector : pass UI values to StartLogin function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-pass-UI-values-to-StartLogin-function/m-p/2213548#M33218</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply but it does not reply to my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found the solution to get those values :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="line"&gt;StartLogin = (clientApplication, dataSourcePath, state, display) =&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;    let&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;      authorizeUrl = AUTHORIZE_URI &amp;amp; "?" &amp;amp; Uri.BuildQueryString([&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        response_type = "code",&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        client_id = Json.Document(dataSourcePath)[client_id],  &lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        redirect_uri = REDIRECT_URI,&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        state1 = state,&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        scope = GetScopeString(SCOPES, SCOPE_PREFIX)&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;      ])&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;    in&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;      [&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        LoginUri = authorizeUrl,&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        CallbackUri = REDIRECT_URI,&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        WindowHeight = WINDOW_HEIGHT,&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        WindowWidth = WINDOW_WIDTH,&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;        Context = null&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;      ];&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;You need to parse the "&lt;SPAN class="line"&gt;dataSourcePath" variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="line"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 08:51:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-pass-UI-values-to-StartLogin-function/m-p/2213548#M33218</guid>
      <dc:creator>ochaoui</dc:creator>
      <dc:date>2021-11-30T08:51:49Z</dc:date>
    </item>
  </channel>
</rss>

