Select to view content in your preferred language

Oauth user is logged in but unable to get token

85
0
4 weeks ago
ChaosSteve
Emerging Contributor

I have set up my javascript application with the client ID I generated in my esri online account. 

const esriConfig = {
apiKey: esriMapApiKey
};

var oAuthInfo = new OAuthInfo({
appId: auth-client-id,
popup: false,
});
esriId.registerOAuthInfos([oAuthInfo]);



I am able to login and it returns me to the same page. I am able to do a portal.queryItems.


The issue is that when I add a secure layer to the map, it throws an error saying it is unable to generate a token for the layer. It seems in my network tab, it calls out to 

https://www.arcgis.com/sharing/rest/generateToken after the layer is added. That call returns an error saying 
Unable to generate token for this server
 
Is there something I need to change so that some calls happen before others. Do I need to make a manual POST call to get a token and append it to the URL for the feature service?
0 Kudos
0 Replies