How can I get Authorization OAuth token?

Can I put all these in a js file? In which part of URL I should put my client id?