Jsonwebtoken: a JSON Web Token implementation library for Node.js.Google-auth-library: Google API’s Authentication Client Library for Node.js.Dotenv: a Node.js package that loads environment variables from.CORS: a Node.js package for providing a Connect/Express middleware that can be used to enable cross-origin resource sharing with various options.Express.js: “a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications”.Then, open a terminal and cd into server: cd server.Īfter that, create a server.js file before generating a package.json by running npm init -y. Once your credentials have been stored successfully, you can copy or download the generated Client ID and Secret.Ĭreate another folder in the root directory. Note: when you’re ready to deploy your application, you should replace the URI1 and URI2 with the domain name you want to use - such as. Since my app is hosted on localhost, I set the details as pictured below. Once consent has been set, click on credentials to set your app details. To achieve that, hover on “APIs and services” and click on “OAuth consent screen”. The next step is to configure oauth consent. The next screen you see should look like the sample below. I chose connect-google-auth-article.Ĭlick on the dropdown in step 1 to select the project. After that, click on the new project highlighted below.Īdd a project name. Step 1Ĭlick on the dropdown highlighted above. The first step to take in order to implement Google authentication is to generate a client ID and secret for the application you’re creating.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |