You can use the PrintingTools service to print maps that contain secured services.
If your ArcGIS Server site is federated with an ArcGIS Enterprise portal and only the portal's ArcGIS Web Adaptor uses web-tier authentication (IWA, client-certificate authentication, Basic, etc.), printing secured services will work as expected. The same is true for deployments that do not use web-tier authentication systems.
However, if your ArcGIS Server site's Web Adaptor uses web-tier authentication, the PrintingTools service and custom print services will not be able to print any of your site's services. This restriction exists for both federated and stand-alone ArcGIS Server sites.
If you secure your services using short-term tokens (the default), the user will be asked to provide the name and password on opening the web app. The token is then passed to the PrintingTools service when the user requests a map to be printed.
The Print service does not support IP based tokens.
Embed credentials into a service
In some cases, when publishing your own print service that contains secured services, you need to embed credentials into the print service that it can use when requesting maps from the secured services.
If you embed a long-term token in your web app code, the authentication information cannot be passed to the PrintingTools service. Regardless of your server configuration, you need to embed credentials into the print service.
If you enforce security at the web server tier, and your ArcGIS Server site is federated with an ArcGIS Enterprise portal, printing maps with the PrintingTools service is supported by default with no additional steps required. However, if you have a stand-alone installation of ArcGIS Server and you enforce security at the web server tier, you need to embed credentials.
It is not recommended to embed credentials in a custom print service without fully understanding the security impact. If you choose to publish your own service for printing with embedded credentials, it's recommended that you apply ArcGIS Server security rules to restrict who can access the service. This prevents anonymous users from generating printable map images that display your secured services. See Control access to your services to learn more about setting up security.
To embed credentials in a custom print service from ArcGIS Pro, you can use the ImportCredentials function in ArcPy.