尝试从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) 任何人都可以指出我正确的方向吗?
我正在使用以下 Python 代码运行 Chrome:
opts = Options()
opts.add_argument("--disable-extensions")
self.browser = webdriver.Chrome(chrome_options=opts)
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
我试过通过代码禁用扩展......以及在运行代码之前从 Chrome 中实际删除所有扩展。两种解决方案都没有奏效。
我正在使用以下代码运行代码: