introspectOAuth2TokenWithIAM method

Future<IntrospectOAuth2TokenWithIAMResponse> introspectOAuth2TokenWithIAM({
  1. required String token,
  2. String? tokenTypeHint,
})

Grants permission to inspect the metadata and state of an OAuth 2.0 access token or refresh token Implements RFC 7662 OAuth 2.0 Token Introspection over a SigV4-authenticated endpoint. Inspects the metadata of an access_token or refresh_token issued by AWS Sign-In and returns the claims associated with it. Inactive token semantics (RFC 7662 ยง2.2): when the supplied token is unknown, expired, revoked, malformed, or owned by a different account, the response body is exactly { "active": false } with all other claims omitted.

May throw AccessDeniedException. May throw InternalServerException. May throw TooManyRequestsError. May throw ValidationException.

Parameter token : The string value of the token to introspect. May be either an access_token or a refresh_token issued by AWS Sign-In.

Parameter tokenTypeHint : Optional hint about the type of the token submitted for introspection. The server uses this hint to optimize lookup, but still falls back to the other token type on miss. Allowed values: access_token, refresh_token.

Implementation

Future<IntrospectOAuth2TokenWithIAMResponse> introspectOAuth2TokenWithIAM({
  required String token,
  String? tokenTypeHint,
}) async {
  final $payload = <String, dynamic>{
    'token': token,
    if (tokenTypeHint != null) 'token_type_hint': tokenTypeHint,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/introspect?x-amz-client-auth-method=iam',
    endpoint: _resolveEndpoint(
      isoAuthEndpoint: true,
    ),
    exceptionFnMap: _exceptionFns,
  );
  return IntrospectOAuth2TokenWithIAMResponse.fromJson(response);
}