{"id":21151407,"url":"https://github.com/vicky-peace/oauth2.0-node-express-react","last_synced_at":"2025-03-14T14:25:40.195Z","repository":{"id":240926222,"uuid":"803710293","full_name":"Vicky-peace/OAuth2.0-node-express-react","owner":"Vicky-peace","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-21T14:28:27.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T08:11:27.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vicky-peace.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-21T08:40:59.000Z","updated_at":"2024-05-21T14:28:31.000Z","dependencies_parsed_at":"2024-11-20T11:11:14.359Z","dependency_job_id":null,"html_url":"https://github.com/Vicky-peace/OAuth2.0-node-express-react","commit_stats":null,"previous_names":["vicky-peace/oauth2.0-node-express-react"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vicky-peace%2FOAuth2.0-node-express-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vicky-peace%2FOAuth2.0-node-express-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vicky-peace%2FOAuth2.0-node-express-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vicky-peace%2FOAuth2.0-node-express-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vicky-peace","download_url":"https://codeload.github.com/Vicky-peace/OAuth2.0-node-express-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243591284,"owners_count":20315826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T10:16:17.717Z","updated_at":"2025-03-14T14:25:40.172Z","avatar_url":"https://github.com/Vicky-peace.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google OAuth 2.0 with JavaScript\n\n---\n\nOpen Authentication [OAuth](https://oauth.net/2/) is an open-standard authorization protocol or framework that provides applications the ability for “secure designated access.” It is a way for users to grant websites or applications access to their information without giving away their passwords.\n\nThis README.md file provides a step-by-step guide on implementing Google OAuth 2.0 authentication using JavaScript for your web application(s). Google OAuth 2.0 allows users to sign in to your application using their Google credentials.\n\nPrerequisites\nBefore you begin, make sure you have the following:\n\n\u003e Google Developer Console project with OAuth 2.0 credentials.\n\u003e A web server to host your application.\n\u003e Basic knowledge of HTML, CSS, and JavaScript.\n\n# Steps\n\n## 1. Create a Project in Google Developer Console\n\nGo to the [Google Developer Console](https://console.cloud.google.com)\nCreate a new project or select an existing one.\nFor this example let us name it Google OAuth Example. Make sure to select the project so that a left sidebar appears in your window.\n\n## 2. Enable Google API\n\nIn the dashboard, click on **_APIs \u0026 Services_** and then **_Dashboard_**.\nClick on the **_+ ENABLE APIS AND SERVICES_** button.\n\n\nScroll through till you find **_Google+ API_** and enable it.\n\n\n## 3. Create OAuth 2.0 Credentials\n\nIn the left sidebar, navigate to **_Credentials_**.\nClick on **_Create Credentials_** and choose **_OAuth client ID_**.\n\n\n\u003e In case you haven't already, you may be prompted to create your **_OAuth Consent Screen_**. I found these params to work well for the OAuth Consent Screen.\n\u003e i. User type - External\n\u003e ii. App name - Google OAuth Example\n\u003e iii. User Support Email - \"Your email here\"\n\u003e iv. App logo - _Optional_\n\u003e v. App domain - _Optional_\n\u003e vi. Developer Contact Information - \"Your email here\"\n\u003e vii. Scopes and permissions - _Optional_\n\u003e viii. Test Users - Add 1 or more email addresses for testing\n\u003e ix. Scroll down to **_Back to Dashboard_** and publish the app (make it available to any gmail address)\n\nSet application type to **_Web application_**.\n\nAdd the authorized JavaScript origins and redirect URIs for your project, for example:\nApplication type* = Web Application\nName* = Web Client 1\nAuthorised JavaScript origins URIs = http://localhost:8000\nAuthorised redirect URIs = http://localhost:8000\n\n## 4. Obtain Client ID\n\nOnce created, your **_client ID and client secret_** will be displayed.\nCopy and Save both of these in your .env to be called in your code.\n\n```bash\n    /.env\nGOOGLE_CLIENT_ID =\nGOOGLE_CLIENT_SECRET =\n```\n\nNB// your **.env** files should always be in **.gitignore**!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicky-peace%2Foauth2.0-node-express-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvicky-peace%2Foauth2.0-node-express-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicky-peace%2Foauth2.0-node-express-react/lists"}