Pre-requisites: Setup project info in Google API Console . If you dont have any projects, add a new one. Make sure your OAuth Consent Screen have been configured correctly. If not, then now is the right time. Choose user type 'External' and click Create. Fill up your project's details. Make sure to use your real project name. You will need to insert a link for your application's terms of service & privacy policy. Fortunately, you can just use google drive links for these files. Unless you know what you're doing, only select these scope. Add test users. Review your changes and go back to the dashboard. Click Create credentials > OAuth client ID. Select Web application to create a new client ID. Add your server URLs in Authorized JavaScript origins or it wont work. In my case, adding localhost does nothing and I needed to test my project on the server with working URL instead. Go back to the Credentials menu. Click copy client id on the OAuth 2.0 Client IDs ...
A blog originally made for my portfolio. Now I just share some of my notes here.