我尝试使用OAuth 2.0登录Google。之后我得到了临时授权码,然后用它来获取access_token
,谷歌不会重定向我我设置的URL时后,这里是我的代码做专:
Google无法重定向到我设置的网址,OAuth 2
<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>
我得到了后access_token在JSON中,它不会将我重定向到我的网址,但保留在页面'https://accounts.google.com/o/oauth2/token'中,我不知道为什么。难道我做错了什么?
是的,正确的;)作为问题被标记为* PHP *我只是指的服务器端的流动,这是更安全,但其流量明显好转适合取决于具体的使用情况。 –