Search

Simplivity

Revoking an OAuth 2 token

This example uses curl to illustrate how to revoke an OAuth 2 token. You might revoke a token when you are done using it and you want to free up any outstanding resources, such as vCenter Server sessions.

The following curl command revokes an OAuth 2 token:

curl -k https://[host]/api/oauth/revoke -H "Authorization: Bearer
0a08c809-17ff-479f-b0a8-aedd4d8305a0"

Where:

  • host is the IP address of the Virtual Controller.

You must supply the -kswitch due to the use of self-signed certificates. You can import these certificates into your local certificate store.

The call returns HTTP status 200 without any body.

HPE Developer Newsletter

Stay in the loop.

Sign up for the HPE Developer Newsletter or visit the Newsletter Archive to see past content.

By clicking on “Subscribe Now”, I agree to HPE sending me personalized email communication about HPE and select HPE-Partner products, services, offers and events. I understand that my email address will be used in accordance with HPE Privacy Statement. You may unsubscribe from receiving HPE and HPE-Partner news and offers at any time by clicking on the Unsubscribe button at the bottom of the newsletter.

For more information on how HPE manages, uses, and protects your personal data please refer to HPE Privacy Statement.