How do I implement an OAuth2 flow in my UI?

Thanks