Custom authentication provider

I have seen none. It would be amazing to have a how-to guide on this.

I would do the same as it looks like you have done. Look at how the Panel Basic and OAuth authentication is defined for inspiration.