This is a deno helper script that can fetch a user's ID Token used for accessing resources protected by AWS Cognito.
To run:
deno run --unstable --allow-env --allow-read --allow-net https://gist.githubusercontent.com/matmunn/c64a43dd10bc29c2f8dffa67a7f8b91f/raw/0e766f98fe05c656e3661c28929142abb96f25f7/cognito-helper.ts <aws_region> <aws_cognito_client_id>
and
can be supplied as environmental variables - AWS_REGION
and AWS_COGNITO_CLIENT_ID
respectively.