How to best connect to external resources with a configurable authentification method?

There are many ways how you could approach it. The easiest would be to store sensitive information with a Secret block and implement the actual logic in your code.