Has anyone implemented full OAuth2 in a plugin - including the sign-up phase?

I know that Philippe did some of it for YT plugin but that one involves end-user copy/pasting tokens - however, I think it handles token renewal which I might be able to copy.

I think I need it to access the new Premium channels from planetradio / Bauer.