introspectTokenWithHttpInfo method
Token introspection
Introspects a token to determine its validity and metadata. Per RFC 7662, returns active: false for invalid tokens.
Note: This method returns the HTTP Response.
Parameters:
Implementation
Future<Response> introspectTokenWithHttpInfo(String token, String clientId, { String? clientSecret, }) async {
// ignore: prefer_const_declarations
final path = r'/oauth/introspect';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/x-www-form-urlencoded'];
if (token != null) {
formParams[r'token'] = parameterToString(token);
}
if (clientId != null) {
formParams[r'client_id'] = parameterToString(clientId);
}
if (clientSecret != null) {
formParams[r'client_secret'] = parameterToString(clientSecret);
}
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}