Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
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.