<?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: Client Creation/Login - Web Browser Page/Tab Auto Close in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Client-Creation-Login-Web-Browser-Page-Tab-Auto-Close/m-p/106690#M3144</link>
    <description>&lt;P&gt;For context, is this a web app that users will be accessing over the internet? If so, you should return a redirect (instead of opening the browser on the system) to send the user to the authorize page, and use the callback to send the user back to your app, so that it all uses the same tab.&lt;/P&gt;

&lt;P&gt;If this is a desktop app, there isn't necessarily a good solution, unfortunately. JavaScript does have &lt;CODE&gt;window.close&lt;/CODE&gt; but that only works for windows that were opened by script to begin with, meaning you'd need to have had another tab that opened it to in the first place. Other solutions would likely be more OS and browser specific (and unfortunately a bit outside the scope of the Dropbox API itself).&lt;/P&gt;

&lt;P&gt;Alternatively, you can do the app authorization flow in an embedded web view in your app, so that you have full control over it, but there are some disadvantages with that. (I.e., It offers less assurance to the user that they're actually on the Dropbox web site, the embedded browser is more likely to be out of date/unsupported, and the user is less likely to already be signed in than they are in their own browser.)&lt;/P&gt;</description>
    <pubDate>Fri, 29 May 2015 05:18:20 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-05-29T05:18:20Z</dc:date>
    <item>
      <title>Client Creation/Login - Web Browser Page/Tab Auto Close</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Client-Creation-Login-Web-Browser-Page-Tab-Auto-Close/m-p/106689#M3143</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
is it possible to the page close automatically after the user create/log into his/her account? For this step a new page/tab is open in the web browser, but it does not close automatically. I also have not found a way (using Python, JS, HTML...) to do so. All I did was put a message asking for the user to close the tab... Here's the code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;def dropboxStart(self):
    self.session = session.DropboxSession(APP_KEY, APP_SECRET, ACCESS_TYPE)
    self.requestToken = self.session.obtain_request_token()
    urlDropbox = self.session.build_authorize_url(self.requestToken, "http://localhost:8082/createClient/")
    webbrowser.open(urlDropbox)

def createClient(self, oauth_token, uid):
    accessToken = self.session.obtain_access_token(self.requestToken)
    self.client = DropboxClient(self.session)
    return """
        &amp;lt;html&amp;gt;
         &amp;lt;head&amp;gt;
         &amp;lt;/head&amp;gt;
         &amp;lt;body&amp;gt;
         &amp;lt;h1&amp;gt;Connected to Dropbox. Please, close this tab.&amp;lt;/h1&amp;gt;
         &amp;lt;/body&amp;gt;
        &amp;lt;/html&amp;gt;
        """
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is possible to close this new tab automatically right after the log into the Dropbox account?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:42:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Client-Creation-Login-Web-Browser-Page-Tab-Auto-Close/m-p/106689#M3143</guid>
      <dc:creator>Felipe L.3</dc:creator>
      <dc:date>2019-05-29T09:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Client Creation/Login - Web Browser Page/Tab Auto Close</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Client-Creation-Login-Web-Browser-Page-Tab-Auto-Close/m-p/106690#M3144</link>
      <description>&lt;P&gt;For context, is this a web app that users will be accessing over the internet? If so, you should return a redirect (instead of opening the browser on the system) to send the user to the authorize page, and use the callback to send the user back to your app, so that it all uses the same tab.&lt;/P&gt;

&lt;P&gt;If this is a desktop app, there isn't necessarily a good solution, unfortunately. JavaScript does have &lt;CODE&gt;window.close&lt;/CODE&gt; but that only works for windows that were opened by script to begin with, meaning you'd need to have had another tab that opened it to in the first place. Other solutions would likely be more OS and browser specific (and unfortunately a bit outside the scope of the Dropbox API itself).&lt;/P&gt;

&lt;P&gt;Alternatively, you can do the app authorization flow in an embedded web view in your app, so that you have full control over it, but there are some disadvantages with that. (I.e., It offers less assurance to the user that they're actually on the Dropbox web site, the embedded browser is more likely to be out of date/unsupported, and the user is less likely to already be signed in than they are in their own browser.)&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2015 05:18:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Client-Creation-Login-Web-Browser-Page-Tab-Auto-Close/m-p/106690#M3144</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-05-29T05:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Client Creation/Login - Web Browser Page/Tab Auto Close</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Client-Creation-Login-Web-Browser-Page-Tab-Auto-Close/m-p/106691#M3145</link>
      <description>&lt;P&gt;Yeah, I thought so... Anyway, thank you so much for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2015 22:33:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Client-Creation-Login-Web-Browser-Page-Tab-Auto-Close/m-p/106691#M3145</guid>
      <dc:creator>Felipe L.3</dc:creator>
      <dc:date>2015-05-29T22:33:24Z</dc:date>
    </item>
  </channel>
</rss>

