Hiya. I've recently been working off <this guide> ...
# guide
p
Hiya. I've recently been working off this guide to get JWT auth working with my stack, and had some troubles getting the front-end to communicate with the modified api. It would've been great to have the necessary front-end modifications as part of that guide, as tracking down the info elsewhere was a nightmare. In the end it was as simple as passing `headers.Authorization: `Bearer ${(await Auth.currentSession()).getIdToken().getJwtToken()}`` with the
<http://API.post|API.post>
(as otherwise configured in the main guide). It looks like you can also remove the
identityPoolId
from
Amplify.configure.Auth
. It's the sort of feature you'd expect amplify to make easy, but the issue hasn't had any movement in a while https://github.com/aws-amplify/amplify-cli/issues/3390, which makes workarounds tough to figure out.
Of course, my knowledge of auth is ropey at best, so perhaps I'm going about this all wrong. My goal was fairly simple: Allow the API to figure out the
username
of the authorised requester. The identity pool seemed to be getting in the way