【发布时间】:2020-05-03 15:49:48
【问题描述】:
我正在使用 angularx-social-login 向 Google 验证用户。
令牌是这样检索的:
https://accounts.google.com/o/oauth2/iframerpc?action=issueToken&response_type=token%20id_token&login_hint=LOGIN_HINT&client_id=CLIENT_ID&origin=http%3A%2F%2Flocalhost%3A4200&scope=openid%20profile%20email&ss_domain=http%3A%2F%2Flocalhost%3A4200
响应为 JSON 对象,访问令牌为 responseData.access_token。
对于吊销,我首先下载https://accounts.google.com/.well-known/openid-configuration,找到吊销端点为https://oauth2.googleapis.com/revoke?token=TOKEN,然后跟随https://developers.google.com/identity/protocols/OAuth2WebServer#tokenrevoke(在示例框中选择选项卡HTTP/REST)我发送请求:
curl -D- -H "Content-type:application/x-www-form-urlencoded" "https://oauth2.googleapis.com/revoke?token=TOKEN"
但我得到的不是成功的响应:
HTTP/1.1 404 Not Found
Date: Thu, 16 Jan 2020 18:07:59 GMT
Content-Type: text/html; charset=UTF-8
Server: ESF
Content-Length: 1710
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
响应的正文包含类似“在此服务器上找不到请求的 URL ...。这就是我们所知道的一切。”
我已经尝试过使用DELETE 或POST 或将Authorize 标头中的令牌作为承载令牌而不是查询参数传递,但无济于事;响应总是一样的。
出了什么问题?
【问题讨论】:
标签: angular oauth-2.0 google-api google-oauth