Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Node.js API Authentication Quickstart

A minimal plain Node.js example showing how to protect an API with access token validation using MonoCloud.

What this repo shows

  • MonoCloud access token validation with a plain Node.js (node:http) server
  • JWT access tokens validated locally and opaque tokens introspected, automatically
  • Accessing the authenticated user's claims

Built with @monocloud/backend-node.

Prerequisites

Before you begin:

  1. In the MonoCloud Dashboard, create a new API
  2. Set the Audience (for example https://api.example.com) — this uniquely identifies your API
  3. Add a scope named example-api and mark the scope as a default scope

Configure environment variables

This repo includes a .env template. Replace the placeholders with values from your API:

MONOCLOUD_BACKEND_TENANT_DOMAIN=https://<your-domain>
MONOCLOUD_BACKEND_AUDIENCE=https://<your-api-identifier>

Do not commit real secrets. This file is for local development only.

Run locally

npm install
npm start

The server starts on http://localhost:3000.

Test

curl -H "Authorization: Bearer <your-access-token>" http://localhost:3000

📘 Learn more

🤝 Contributing & Support

Issues & Feedback

  • Use GitHub Issues for bug reports and feature requests.
  • For tenant or account-specific help, contact MonoCloud Support through your dashboard.

Security

Do not report security issues publicly. Please follow the contact instructions at: https://www.monocloud.com/contact

License

Licensed under the MIT License. See the included LICENSE file.

About

MonoCloud Node.js Api Authentication Quickstart Repository

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages