小编Sea*_*rle的帖子

Google oAuth:redirect_uri_mismatch

尝试从Google获取oAuth令牌时,我们收到"redirect_uri_mismatch"错误:

[client 127.0.0.1:49892] {\n  "error" : "redirect_uri_mismatch"\n}, referer: `http://localhost/oAuth/chess-login.html`
Run Code Online (Sandbox Code Playgroud)

有两个文件正在使用:chess-login.html和plus.php(下面的代码).

Google API具有以下URI:

http://localhost/oAuth/chess-login.html
Run Code Online (Sandbox Code Playgroud)

有人能指出解决方案吗?

plus.php:

<?php

    $client_id = "XXX.apps.googleusercontent.com"; //your client id
    $client_secret = "XXX"; //your client secret
    $redirect_uri = "http://localhost/chess-login.html";
    $scope = "https://www.googleapis.com/auth/plus.login"; //google scope to access
    $state = "profile"; //optional
    $access_type = "offline"; //optional - allows for retrieval of refresh_token for offline access

    if(isset($_POST['results'])){
        $_SESSION['accessToken'] = get_oauth2_token($_POST['results']);
    }

    //returns session token for calls to API using oauth 2.0
    function get_oauth2_token($code) {
        global $client_id;
        global $client_secret;
        global $redirect_uri;

        $oauth2token_url …
Run Code Online (Sandbox Code Playgroud)

php oauth google-api google-api-php-client

2
推荐指数
1
解决办法
5375
查看次数

Selenium Chromedriver“加载扩展失败”

任何人都可以指出我正确的方向吗?

我正在使用以下 Python 代码运行 Chrome:

opts = Options()
opts.add_argument("--disable-extensions")
self.browser = webdriver.Chrome(chrome_options=opts)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

在此处输入图片说明

我试过通过代码禁用扩展......以及在运行代码之前从 Chrome 中实际删除所有扩展。两种解决方案都没有奏效。

我正在使用以下代码运行代码:

  • ChromeDriver 2.28
  • 铬 V57.0.2987.110
  • 硒 3.3.1
  • 蟒蛇 2.7

python selenium google-chrome python-2.7

1
推荐指数
1
解决办法
8336
查看次数