Sorry to hear about the trouble.
I think you're looking for the portalUrl property:
We have this doc'ed in some samples to use a resource from your own Portal:
I've found and tried with that example. However, the issue is that the services and such are secured. Portal is federated. When I try to access the webmap using just the esriConfig.portalUrl, I get a 401 error saying unauthorized; i'm assuming i need to somehow generate and use a token for this, but I can find zero examples. To be clear, I only get that 401 error when I try to access it in code; if i simply put the url into my browser directly, it allows me to access it.
Are you prompted to enter a username and password? For secure resources, it should automatically prompt you.
Another option would be to use a self-hosted proxy to authenticate for you:
Using an app login or a user login: