'How to write a program which is Oauth2 server and client

guys
I want to write a system whose login system depends on third party Oauth2 provider, like github. Meanwhile, this system would provide Oauth2 service. This means I don't want to write login system by my self, but it still could provide Oauth2 service without twice jump between sites.
For if my system would provide Oauth2 service, the client will jump to github to login, then jump to my Oauth2 page to ask another confirmation.
Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source