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
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?