Trying to login to our company portal in ArcGIS Enterprise using (JavaScript 4.23), but the login takes me to ArcGIS Online. I provide the url in my JavaScript, but this still happens. Can you advise please. Thank you.
This is the code I use for testing the OAuth login and I get the proper Sign in screen.
const portalUrl = 'my portal url';
const info = new OAuthInfo({
appId: "my appID", //*** Your Client ID value goes here ***//
popup: false // inline redirects don't require any additional app configuration
});
identityManager.registerOAuthInfos([info]);
identityManager.getCredential(portalUrl);
identityManager.checkSignInStatus(portalUrl).then(function () {
layer = new FeatureLayer({
url: 'my unshared service url',
outFields: ["*"]
});
map = new Map({
basemap: 'oceans',
layers: [layer]
});
view = new MapView({
container: "viewDiv",
map: map,
center: [-153, 63],
zoom: 4,
popup: {
autoOpenEnabled: false
}
});
});