How to use OAuth


I was using @Anywhere for single sign on,Since its going to be deprecated now i need to use oAuth,can anyone please guide me how to use oAuth,steps to implement the oAuth for single sign on ang how it works.I was using jsp and js.Need to develop using jsp.