I would like to decode & verify the IdToken provided by AWS cognito. Simple code that could be used on NodeJs(server) and Browser (the same code).
I tried to use the classic jwt-decode but it has some problems on the browser side due dependencies on crypto lib.
I end up using
Joseonly, as I mentioned in a comment. I faced some minor issues. Jose offers a built-int method to getJWK, but I wanted to cache the response in-memory by my own means.USER_POOL_IDandREGIONare required as env.vars.I am looking forward to any suggestions.