I am trying to add a Feature Layer to my application that sources data from a FeatureServer URL that is hosted internally, not on an ArcGIS server. The URL requires authentication to access, either through a token parameter or an authorization header. How do I have ArcGIS JS (4.8) add the token to the URL when creating the feature layer? I have tried IdentityManager.initialize and the token property on the FeatureLayer object with no luck. Most information on how to authenticate requests is specifically for authenticating to an ArcGIS hosted resource, not something hosted elsewhere.
The other tool we're using is a Node Express server hosting data from a MarkLogic database server as Feature Layers, koop-provider-marklogic. Without authentication enabled everything works fine, but that's less than ideal for security reasons.