Skip to content

code-for-magdeburg/magdeburggiesst-user-management-api

 
 

Repository files navigation

Node.js CI Renovate

Giessdenkiez.de User Management API

vercel + auth0 management api for giessdenkiez.de To be able to manage user data and delete users.

Setup

In your Auth0 tenant create a new machine to machine application. Select the "Auth0 Management API" to authorize this new api to. As permissions make sure to select at least read:users and delete:users.

When done you should have example code to obtain an access token from Auth0 to communicate with this API and allow communication with the management API.

Install all the dependencies:

npm ci

Connect to your vercel account

npx vercel login

Deploy your application to vercel.com

npx vercel

To function correctly you will have to add some environment variables to your vercel project. See the .env.sample file for the values you need. Each one needs to be added using the vercel secrets command. Use npx vercel secrets --help for more info on this command.

npx vercel secrets add <name> <value>

Now deploy your application again to with woring credentials.

Endpoints

The API has two endpoints. One for healthcheck and one for user management. The second one allows OPTIONS, GET and DELETE requests.

### healthcheck

GET <API URL>/api

### options

OPTIONS <API URL>/api/user

### get user by id

GET <API URL>/api/user?userid=<auth0 user id>
Authorization: Bearer <ACCESS TOKEN>

### delete user by id

DELETE <API URL>/api/user?userid=<auth0 user id>
Authorization: Bearer <ACCESS TOKEN>

Development

Run npx vercel dev to start a local development server.

Tests

npm t
# or
npm run test:watch

Contributors

Thanks goes to these wonderful people (emoji key):


Fabian Morón Zirfas

📖 💻 🎨

Lucas Vogel

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

Made by

A project by

Supported by

About

User management API for giessdenkiez.de

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.1%
  • JavaScript 2.9%