Vagrant中的Dropbox App redirect_url - 非本地OAuth 2重定向URI可能无法以“http:”或“javascript:”开头

问题描述 投票:1回答:1

我正在尝试我的第一个Dropbox API集成项目。我的开发环境是Vagrant(192.168.33.10),我使用主机名ppt.dev从我的主机访问该站点。问题是,Dropbox只允许localhost作为开发中的app的redirect_uri,或者我需要提供一个带有https作为重定向URI的URL。如果我给我的开发URI(下面给出的图像),我得到了这个错误。

Dropbox App错误:

我不知道如何解决这个问题。有可能我可以在我的Vagrant中启用https(使用Ubuntu 14.04),或者我可以在Dropbox App中执行任何操作,这将使我能够访问添加开发URI。

php api vagrant dropbox dropbox-api
1个回答
1
投票

啊,我在其他网站的一些内容的帮助下解决了。

The easiest and fastest way to do it would be to use those 4 lines

sudo make-ssl-cert generate-default-snakeoil --force-overwrite
sudo a2enmod ssl
sudo a2ensite property-ssl.conf
sudo service apache2 reload

并在/etc/apache2/sites-available/property-ssl.conf中添加这些行。参考here

<Directory /var/www/html/property/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

现在在我的开发站点可以使用https访问,我可以将https://ppt.dev/dropbox/callback URL添加到Dropbox应用程序。

© www.soinside.com 2019 - 2024. All rights reserved.