This Github repository guide you through how you can make and manage Oauth in your application using PHP scripts.