简体   繁体   English

通过POST撤消Rails Doorkeeper令牌

[英]Revoke Rails Doorkeeper Token via POST

We know if we utilise the Resource Owner Password Credential flow for doorkeeper, the generated JSON params for POST are based on the URL here : 我们知道,如果我们利用守门人资源所有者密码凭据流,用于POST生成的JSON PARAMS是基于URL 在这里

{
  "grant_type"    : "password",
  "username"      : "user@example.com",
  "password"      : "sekret",
  "client_id"     : "the_client_id",
  "client_secret" : "the_client_secret"
}

I would like to perform a token revocation via POST to /oauth/revoke; 我想通过POST到/ oauth / revoke执行令牌撤销; thus, what parameters which I need in order to perform the POST via JSON? 因此,我需要什么参数才能通过JSON执行POST?

Thanks! 谢谢!

Ok I got it figured out; 好吧,我明白了。 basically I need to send the following: 基本上,我需要发送以下内容:

curl -H "Authorization: Bearer <token>" \
     -F token=<token>\
     -X POST http://livedo-gunter.codio.io:3000/oauth/revoke

This is based on the link here . 这是基于此处的链接。 Basic authorization has to be enabled first though. 不过,必须先启用基本授权。

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

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