TsgcHTTP_OAuth2_ClientMethods › Introspect

Introspect Method

Queries token status and metadata per RFC 7662.

Syntax

procedure Introspect(const aToken: String; const aTokenTypeHint: String = '');

Parameters

NameTypeDescription
aTokenconst StringThe access or refresh token whose state should be queried.
aTokenTypeHintconst StringOptional hint about the token type, typically 'access_token' or 'refresh_token'. Defaults to an empty string.

Remarks

Sends a POST request to AuthorizationServerOptions.IntrospectionURL as defined in RFC 7662. The server responds with a JSON document indicating whether the token is active plus metadata such as scope, client_id, username, and exp. Requires AuthorizationServerOptions.IntrospectionURL to be set. Results are delivered via OnAfterIntrospectToken; errors via OnErrorIntrospectToken.

Example

// Introspect the current access token
OAuth2Client.Introspect(OAuth2Client.AccessToken, 'access_token');
// Introspect without specifying the token type hint
OAuth2Client.Introspect(OAuth2Client.AccessToken);

Back to Methods