Need some links explaining getting and setting esri portal user credentials using ArcGIS Javascript API
If you learn best with samples like I do, you can download a working example here (it is included in the doc Rene provided as well)
Here are a couple of guides that might help you.
Working with the ArcGIS Platform | ArcGIS API for JavaScript 4.14
Access secure resources | ArcGIS API for JavaScript 4.14
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.