Oauth with Esri React

03-10-2021 01:17 PM
New Contributor

I need to use oauth2 to allow users on our platform to login with Esri and view their private layers. With vanilla javascript, I would use IdentityManager  however, I cannot find an equivalent for use in React. Namely, I don't know what import statement to use to import the identity manager and oauth Esri packages.


I've found the arcgis node repo but the documentation doesn't state how I can use oauth.

0 Kudos
1 Reply
Frequent Contributor II

This app uses Vue with OAuth, but the patterns are the same regardless of framework being used.



You can replace with the imports from esri to @ arcgis/core if you use the ESM package.

Don't forget to have an oauth-callback.html page as shown here.



The syntax on the page is different than what is in the vue app above.

0 Kudos