新浪微博OAuth2.0授权出现error:redirect_uri_mismatch解决方法

05-06 | 夜光 | IT记录

新浪微博OAuth2.0授权的回调地址,需要在微博开放平台那里设置与应用配置config.php中一致,否则就会提示error:redirect_uri_mismatch

一、SAE平台微博OAuth2.0应用配置config.php

<?php
header('Content-Type: text/html; charset=UTF-8');
define( "WB_AKEY" , 'xxxxxxxxxx' ); //APP_Key
define( "WB_SKEY" , 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ); //APP_Secret
define( "WB_CALLBACK_URL" , 'https://'.$_SERVER["HTTP_APPVERSION"].'.'.$_SERVER["HTTP_APPNAME"].'.sinaapp.com/callback.php' );
//$_SERVER["HTTP_APPVERSION"] 版本号,可以不加
//$_SERVER["HTTP_APPNAME"] 应用名
?>

二、微博开放平台那里设置
在微博开放平台那里“应用信息”-“高级信息”-设置“应用回调页”为

本文标签: ,
本文链接: sina-weibo-oauth2-redirect-uri-mismatch/
版权所有: 玻璃泉, 转载请注明本文出处。