added the code for working with oauth