Adding OAuth to your ArcGIS JS Apps
This video covers how you can add OAuth to your ArcGIS API for JavaScript applications. We’ll even cover how to create your own application in ArcGIS Online so that you can generate a clientId and a clientSecret that you can use in a proxy or as part of the IdentityManager in the API.
You can review the Esri Proxy here and choose the best option for your needs.