/se2-auth-demo

A small example that shows how to add authentication to your API using Google

Primary LanguageJavaScript

se2-auth-demo

Build Status

A small example that shows how to add authentication to your API using Google.

Run

Clone the repo and install the dependencies by doing

$   npm i

Copy the .env.example file and name the copy .env. Configure in the .env file the information to contact the Google API (read the beginning of this post).

Run the application by doing:

$   npm start

Endpoints

To call the protected endpoint you need to pass in the token

$ curl -v -H "Authorization: Bearer <generated token>" http://localhost:3000/api/v1/me
$ curl -v http://localhost:3000/api/v1/me?access_token=<generated token>