How do I connect a third-party app that needs authentication?

I want to have a workflow talk to an outside service, but it needs me to sign in or provide credentials first. What’s the clean way to connect a third-party app in 3B so my workflow can act on my behalf? I’m curious how the connection gets stored and how I reference it once it’s set up. A pointer to the recommended flow would help me get started on the right foot.