繁体   English   中英

Instagram redirect_url 剥离查询字符串

[英]Instagram redirect_url stripping query strings

所以我正在开发一个 Instagram 基本显示调用,出于某种原因,它正在剥离一个查询字符串。

这是所有信息
/auth/authenticate/ 按钮所在的位置: ***/wp-admin/options-general.php?page=instagram_auth

$auth_url.= '/?client_id='. $this->instagram->get_client_id(). '&redirect_uri='. $this->instagram->get_redirect_uri(). '&scope=user_profile,user_media&response_type=code';

auth window 弹出以下代码,然后我可以进行身份验证:

https://www.instagram.com/oauth/authorize/?client_id=28822****&redirect_uri=****/wp-admin/options-general.php?page=instagram_auth&scope=&_code=profile,user_media_auth&scope=&_codetype

这是问题所在:

当我点击“接受”时,Instagram 会重定向到:

/wp-admin/options-general.php?code=AQBWjP-foZA7tkhUCTZygn5CBNbiJJxmY364eLPm0bD9NpetQbzUqJSw4LiueRDg_jiDzW8l_8js2JHFAZcPom8zFR-86x_*-X11H1-kTPCPrQ#_

它去除了我的代码中需要的?page=instagram_auth参数。我的有效 OAuth 重定向 URI 是: ***/wp-admin/options-general.php?page=instagram_auth

有谁知道为什么参数被剥离?

有一个state参数可以添加到 OAuth 授权请求中,该请求将在重定向到您的重定向 URI 时通过。

An optional value indicating a server-specific state. For example, you can use this to protect against CSRF issues. We will include this parameter and value when redirecting the user back to you.

(From the Facebook Instagram API docs) https://developers.facebook.com/docs/instagram-basic-display-api/reference/oauth-authorize

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM