Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arbiminanda/secret-auth-apps
https://github.com/arbiminanda/secret-auth-apps
bootstrap css dotenv ejs express html mongoose-encryption passport passport-google-oauth20
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/arbiminanda/secret-auth-apps
- Owner: arbiminanda
- Created: 2023-04-04T02:32:06.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-05T15:07:35.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T21:35:23.851Z (3 months ago)
- Topics: bootstrap, css, dotenv, ejs, express, html, mongoose-encryption, passport, passport-google-oauth20
- Language: JavaScript
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Secrets: Fullstack Express Authentication Apps
This is fullstack express project to implement general and google authentication
# Run Script
- Open terminal/cmd, go to the project directory and install all dependencies
```
npm install
```- Setup MongoDB server on your device, you can use [this](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/) as reference
- Create a database with name "secret_auth_apps", create a collection with name "users"
- This project use [Passport Google Authentication](https://www.passportjs.org/packages/passport-google-oauth20/) for google auth mechanism, for this purpose you should setup google console API for authentication:1. Add project in [Google Console API](https://console.cloud.google.com/apis/dashboard)
2. Setup OAuth Consent Screen
3. Create OAuth clientID in credentials section, you should set type to web application, input base url of your apps, and set url for google authorization callback```
{baseUrl}/auth/google/secrets
```4. You will get clientId and clientSecret
- Copy file .env.example to .env, and edit the content of that file:
```
BASE_URL: Base url of your apps
SECRET_KEY: random string for encryption in general authentication purpose
CLIENT_ID: clientId from Google Console API
CLIENT_SECRET: clientSecret from Google Console API
```- Run this command to run the server:
```
nodemon server.js
```