Basic Authentication with JavaScript - Security?


#1

Hello,
I am trying to create a basic app leveraging what I’ve learnt on codecademy JavaScript about APIs. I need to access an API which accepts both basic authentication and OAuth2, but I don’t know yet how to setup OAuth2. I want to GET and POST data through a local app (on my machine) using the basic authentication (and JavaScript fetch()), but it’s very important to not expose my login details to security threats. I am using cors (https://cors-anywhere.herokuapp.com/) to add the necessary headers to my call (to bypass http / cross domain problems) and my app is on my local machine. Could you please advice if this is ok from a security point of view? Since it’s local, am I exposing my login details?

Thank you!
Mihai