Automatic JWT authentication with onClick function

Asked

Viewed 13 times

-2

I am creating a web service to consume an api and facilitate scheduling events on google Calendar. To access this data it is necessary that the user uses a JWT token to be able to request the data via GET and POST method.

My question is: how to create a button where using onClick I can capture the user and password values typed by the user and store them in variables so I can make a request for a JWT using only html and javascript?

If it is possible also please tell me how I step to make requests in javascript, I have used Postman and everything has been right but I do not know how to pass this data to a web page.

  • https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

  • Please edit the question to limit it to a specific problem with sufficient detail to identify an appropriate answer.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.