Sunday, 5 August 2018

Using PassportJS credentials for API calls

I currently have a calendar built with HTML & jQuery where each time the user clicks on a date, it saves the date to sessionStorage, and calls an XMLHttpRequest function to DynamoDB to update the webpage with the content from that date. I now added authentication and serve the HTML page with ExpressJS (Haven't had time to learn a real front-end framework yet)I am now using PassportJS to authenticate the user and store an access token under user.accessToken. This is the access token used to call my API Gateway on AWS with Bearer:Token authentication. How can I pass this into the client so that the XMLHttpRequest can use it?

Submitted August 05, 2018 at 08:59AM by Lunoxus

No comments:

Post a Comment