{"id":15612347,"url":"https://github.com/jpalumickas/node-oauth2-server-grant-type-google","last_synced_at":"2025-10-27T00:23:59.732Z","repository":{"id":65467309,"uuid":"297108456","full_name":"jpalumickas/node-oauth2-server-grant-type-google","owner":"jpalumickas","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-05T23:03:14.000Z","size":280,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T05:17:14.330Z","etag":null,"topics":["google","node","nodejs","oauth","oauth2","oauth2-server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpalumickas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-09-20T15:43:07.000Z","updated_at":"2025-02-05T23:03:18.000Z","dependencies_parsed_at":"2025-02-06T00:18:55.185Z","dependency_job_id":"98b1a9b0-f176-408e-8427-5c70150d6cb0","html_url":"https://github.com/jpalumickas/node-oauth2-server-grant-type-google","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/jpalumickas/node-oauth2-server-grant-type-google","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpalumickas%2Fnode-oauth2-server-grant-type-google","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpalumickas%2Fnode-oauth2-server-grant-type-google/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpalumickas%2Fnode-oauth2-server-grant-type-google/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpalumickas%2Fnode-oauth2-server-grant-type-google/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpalumickas","download_url":"https://codeload.github.com/jpalumickas/node-oauth2-server-grant-type-google/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpalumickas%2Fnode-oauth2-server-grant-type-google/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265540567,"owners_count":23784933,"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":["google","node","nodejs","oauth","oauth2","oauth2-server"],"created_at":"2024-10-03T06:41:52.852Z","updated_at":"2025-10-19T12:03:22.851Z","avatar_url":"https://github.com/jpalumickas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuth2 Server Google Grant Type\n\nAdds Google grant type for [oauth2-server][oauth2-server]\n\n## Installation\n\nUsing Yarn\n```sh\nyarn add oauth2-server-grant-type-google\n```\n\nUsing NPM\n\n```sh\nnpm install oauth2-server-grant-type-google\n```\n\n## Usage\n\n\nAdd `getUserWithGoogle` to [oauth2-server] model.\n\n```js\n  const getUserWithGoogle = async (googleData) =\u003e {\n    // Find and return user by Google ID\n\n    // Find and return user by Google email\n\n    // If not exists create new user\n  };\n```\n\nAdd Google grant type to `extendedGrantTypes` in [oauth2-server] options:\n\n```js\n  import GoogleGrantType from 'oauth2-server-grant-type-google';\n\n  const options = {\n    model: ...,\n    extendedGrantTypes: {\n      google: GoogleGrantType,\n    }\n    requireClientAuthentication: {\n      google: false,\n    },\n  }\n```\n\nYou need to provide Google Client ID in model `googleGrantType`  :\n\n```js\nconst options = {\n  model: {\n    ...model,\n    googleGrantType: {\n      clientId: 'xxxxxxx.apps.googleusercontent.com' // Array also supported\n    },\n  },\n  extendedGrantTypes,\n}\n```\n\nPost request to `/oauth/token` with `google` grant type and provided id token:\n\n```json\n{\n  \"grant_type\": \"google\",\n  \"client_id\": \"YOUR_CLIENT_ID\",\n  \"google_id_token\": \"GOOGLE_ID_TOKEN\"\n}\n```\n\n## License\n\nThe package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n[oauth2-server]: https://github.com/oauthjs/node-oauth2-server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpalumickas%2Fnode-oauth2-server-grant-type-google","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpalumickas%2Fnode-oauth2-server-grant-type-google","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpalumickas%2Fnode-oauth2-server-grant-type-google/lists"}