<?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 await DropboxOAuth2Helper.ProcessCodeFlowAsync() doesn't completed and breaks between the loop. in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293424#M17873</link>
    <description>&lt;P&gt;I want to get access token using&amp;nbsp;OAuth2Response response = await DropboxOAuth2Helper.ProcessCodeFlowAsync(code, AppKey, AppSecret, uriBuilder.Uri.AbsoluteUri); in &lt;STRONG&gt;C#.Net&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;(not MVC)&lt;/STRONG&gt;.&amp;nbsp;&lt;BR /&gt;Created a method:&lt;/P&gt;
&lt;PRE&gt;public async Task ProcessDropboxCallback(string code)
        {
            var AppKey = "";
            var AppSecret = "";
            var uriBuilder = new UriBuilder(Request.Url);
            uriBuilder.Query = Request.QueryString.ToString();
            uriBuilder.Fragment = null;
            uriBuilder.Query = null;
            OAuth2Response response = await DropboxOAuth2Helper.ProcessCodeFlowAsync(code, AppKey, AppSecret, uriBuilder.Uri.AbsoluteUri);
            string DropboxToken = response.AccessToken;
            Session["DropboxAccessToken"] = DropboxToken;
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and calling above method in &lt;STRONG&gt;page_load&lt;/STRONG&gt; as:&lt;/P&gt;
&lt;PRE&gt;ProcessDropboxCallback(code);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is happening here is when the&amp;nbsp;compiler reaches to await method, the loop breaks.&lt;/P&gt;
&lt;P&gt;It doesn't goes to string Dropbox, so not able to set the token in session. Also it doesn't continues to page_load, loop breaks and the page loads without continuing code after&amp;nbsp;&lt;STRONG&gt;ProcessDropboxCallback(code).&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Stuck in this, need help.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:10:52 GMT</pubDate>
    <dc:creator>JayPatel1992</dc:creator>
    <dc:date>2019-05-29T09:10:52Z</dc:date>
    <item>
      <title>await DropboxOAuth2Helper.ProcessCodeFlowAsync() doesn't completed and breaks between the loop.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293424#M17873</link>
      <description>&lt;P&gt;I want to get access token using&amp;nbsp;OAuth2Response response = await DropboxOAuth2Helper.ProcessCodeFlowAsync(code, AppKey, AppSecret, uriBuilder.Uri.AbsoluteUri); in &lt;STRONG&gt;C#.Net&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;(not MVC)&lt;/STRONG&gt;.&amp;nbsp;&lt;BR /&gt;Created a method:&lt;/P&gt;
&lt;PRE&gt;public async Task ProcessDropboxCallback(string code)
        {
            var AppKey = "";
            var AppSecret = "";
            var uriBuilder = new UriBuilder(Request.Url);
            uriBuilder.Query = Request.QueryString.ToString();
            uriBuilder.Fragment = null;
            uriBuilder.Query = null;
            OAuth2Response response = await DropboxOAuth2Helper.ProcessCodeFlowAsync(code, AppKey, AppSecret, uriBuilder.Uri.AbsoluteUri);
            string DropboxToken = response.AccessToken;
            Session["DropboxAccessToken"] = DropboxToken;
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and calling above method in &lt;STRONG&gt;page_load&lt;/STRONG&gt; as:&lt;/P&gt;
&lt;PRE&gt;ProcessDropboxCallback(code);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is happening here is when the&amp;nbsp;compiler reaches to await method, the loop breaks.&lt;/P&gt;
&lt;P&gt;It doesn't goes to string Dropbox, so not able to set the token in session. Also it doesn't continues to page_load, loop breaks and the page loads without continuing code after&amp;nbsp;&lt;STRONG&gt;ProcessDropboxCallback(code).&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Stuck in this, need help.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:10:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293424#M17873</guid>
      <dc:creator>JayPatel1992</dc:creator>
      <dc:date>2019-05-29T09:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: await DropboxOAuth2Helper.ProcessCodeFlowAsync() doesn't completed and breaks between the loop.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293456#M17874</link>
      <description>&lt;P&gt;It sounds like the issue is that this is an async method, but you're not waiting for the result. I.e., you probably want to await your method call like this:&lt;/P&gt;
&lt;PRE&gt;await ProcessDropboxCallback(code);
&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Aug 2018 17:18:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293456#M17874</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-23T17:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: await DropboxOAuth2Helper.ProcessCodeFlowAsync() doesn't completed and breaks between the loop.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293460#M17875</link>
      <description>&lt;P&gt;Yes, that's true.&lt;/P&gt;
&lt;P&gt;But for that I need to make Page_load method "async". Is that a good thing ? Because I am not aware with what will happen if I add async to Page_Load.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 17:30:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293460#M17875</guid>
      <dc:creator>JayPatel1992</dc:creator>
      <dc:date>2018-08-23T17:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: await DropboxOAuth2Helper.ProcessCodeFlowAsync() doesn't completed and breaks between the loop.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293472#M17877</link>
      <description>That's more of a general C#/async programming design question, so I'm afraid I can't offer insight on that.</description>
      <pubDate>Thu, 23 Aug 2018 18:27:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293472#M17877</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-23T18:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: await DropboxOAuth2Helper.ProcessCodeFlowAsync() doesn't completed and breaks between the loop.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293474#M17879</link>
      <description>&lt;P&gt;No problem. I tried that and now it is working good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for help.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 18:34:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/await-DropboxOAuth2Helper-ProcessCodeFlowAsync-doesn-t-completed/m-p/293474#M17879</guid>
      <dc:creator>JayPatel1992</dc:creator>
      <dc:date>2018-08-23T18:34:31Z</dc:date>
    </item>
  </channel>
</rss>

