function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
moh3enmoh3en 

logout using the instance_url rest

Hi,

is it possible to log out of a session using the rest API? if so how can I log out using this method? please let me know as this has taken me a long time to figure out.

 

cheers

Best Answer chosen by Admin (Salesforce Developers) 

All Answers

Pat PattersonPat Patterson

There is currently no logout facility in the REST API, but we'll be adding it in the Winter '12 release (due real soon now).

 

I don't have the docs to hand, but it will be based on the IETF draft http://www.ietf.org/id/draft-lodderstedt-oauth-revocation-02.txt - something like

 

POST /services/oauth2/revoke HTTP/1.1
Host: login.salesforce.com
Content-Type: application/json

{"token":"45ghiukldjahdnhzdauz","client_id":"s6BhdRkqt3","client_secret":"gX1fBat3bV"}

 

I am reliably informed that there will also be a GET/JSONP mechanism.

 

Cheers,

 

Pat

chuckmortimorechuckmortimore

Note that if the token is an access_token, the session will be terminated.   If the token is a refresh_token, the authorization granted by the user for the application will be terminated.

 

JSONP is indeed being supported.

 

Thanks Pat!

Daniel BallingerDaniel Ballinger

Does this exist yet? I couldn't find any documention for it in the REST API Developers Guide.

 

Thanks.

chuckmortimorechuckmortimore

Search for "revoking oauth tokens" in Help and Training