OauthToken Class
Namespace
Usage
This class is distinct from the Auth.AuthToken class, which contains a method to revoke tokens issued by a third-party provider instead of Salesforce tokens.
OauthToken Methods
The following are methods for OauthToken.
revokeToken(type, authToken)
Signature
public static Boolean revokeToken(Auth.OauthTokenType type, String authToken)
Parameters
-
type:
Type: Auth.OauthTokenType
Specifies the type of token to be revoked. To revoke an opaque access token, use the ACCESS_TOKEN value. To revoke a refresh token and any associated access tokens, use the REFRESH_TOKEN value. To revoke a refresh token and associated access tokens, use the DELETE_TOKEN value. To revoke a JSON Web Token (JWT)-based access token, use the ORG_JWT value.
-
authToken:
Type: String
The access token (opaque or JWT-based), refresh token, or delete token issued by Salesforce.
Return Value
Type: Boolean
The method returns true if successful, and false if not. For invalid or expired tokens, the method returns a NoDataFoundException exception.