I am automating APIs using NPM-Supertest-javascript framework. Currently I am hardcoding the JWT access token (which I get from browser) and it works well. Now I am looking to automate the process of generating access token as well so that there will be no manual intervention.
I can generate the same access token using Postman where I input clientid, clientsecret, callback url, access token url, auth url and grant type etc.
As shown below:
How do I achieve the same using code (javascript-supertest) ? Thanks in advance.