oauth method

Future<TOauthResponse> oauth({
  1. required TOauthBody input,
})

Authenticate a user with an OIDC token (Oauth).

Sign the provided TOauthBody with the client's stamp function and submit the request (POST /public/v1/submit/oauth).

See also: stampOauth.

Implementation

Future<TOauthResponse> oauth({
  required TOauthBody input,
}) async {
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_OAUTH',
  );
  return await request<Map<String, dynamic>, TOauthResponse>(
      "/public/v1/submit/oauth",
      body,
      (json) =>
          TOauthResponse.fromJson(transformActivityResponse(json, 'Oauth')));
}