https://github.com/malopolese/nestjs-oauth2-google-example
Example of the implementation of google oauth2 with NestJs
https://github.com/malopolese/nestjs-oauth2-google-example
google nestjs oauth2 sqllite3 typescript
Last synced: about 2 months ago
JSON representation
Example of the implementation of google oauth2 with NestJs
- Host: GitHub
- URL: https://github.com/malopolese/nestjs-oauth2-google-example
- Owner: MaloPolese
- Created: 2021-12-04T16:24:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-04T23:16:39.000Z (over 4 years ago)
- Last Synced: 2025-04-06T10:30:53.279Z (about 1 year ago)
- Topics: google, nestjs, oauth2, sqllite3, typescript
- Language: TypeScript
- Homepage:
- Size: 239 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Description
Example of the implementation of [google oauth2](https://developers.google.com/identity/protocols/oauth2) with [NestJs](https://nestjs.com/)
## Installation
```bash
$ npm ci
```
Complete the .env file
```dosini
# Example: 1234.apps.googleusercontent.com
AUTH_GOOGLE_KEY= ...
# Example: 1234
AUTH_GOOGLE_SECRET= ...
# Example: http://localhost:3000/oauth2/callback
GOOGLE_CALLBACK_URL= ...
# Example: http://localhost:4200
FRONTEND_URL= ...
```
[Obtain OAuth 2.0 credentials](https://developers.google.com/identity/protocols/oauth2#1.-obtain-oauth-2.0-credentials-from-the-dynamic_data.setvar.console_name-.)
## Running the app
```bash
# watch mode
$ npm run start:dev
```
## Usage
```bash
$ curl --location --request GET 'localhost:3000/oauth2/login/google'
```
## About me
- Author - [Malo Polese](https://www.linkedin.com/in/malo-polese/)
- Website - [malo-polese.fr](https://malo-polese.fr/)