Skip to content

OAuth 2.0 Token Revocation

You shall not pass edited this page Dec 4, 2015 · 1 revision

OAuth 2.0 Token Revocation

https://tools.ietf.org/html/rfc7009

POST /revoke HTTP/1.1
     Host: server.example.com
     Content-Type: application/x-www-form-urlencoded
     Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW

     token=45ghiukldjahdnhzdauz&token_type_hint=access_token

using OAuthSwift

let token = oauthswift.client.credential.oauth_token
var parameters = ["token": token]
// optionally : parameters+= ["token_type_hint": "access_token"]

oauthswift.client.post("server.example.com", parameters: parameters,
 success: {
    data, response in
    print(data)
 }, failure: { error in
    print(error)
})