【发布时间】:2012-10-06 03:41:27
【问题描述】:
我正在尝试使用 OAuth 2.0 登录 Google。在我获得临时授权码并使用它获取access_token 后,Google 不会将我重定向到我在发布时设置的 URL,这是我发布的代码:
<form action="https://accounts.google.com/o/oauth2/token" method="post">
<input type="text" name="code" value='##code##'/>
<input type="text" name="client_id" value='##client_id##'/>
<input type="text" name="client_secret" value='##client_secret##'/>
<input type="text" name="redirect_uri" value='http://boomroom.tv/test.php'/>
<input type="text" name="grant_type" value='authorization_code'/>
<input type="submit" /></form>
在我获得 JSON 中的 access_token 后,它不会将我重定向到我的 URL,而是停留在页面“https://accounts.google.com/o/oauth2/token”中,我不知道为什么。我做错了吗?
【问题讨论】:
标签: php redirect oauth-2.0 youtube-api