melvinodsa/go-iam

By melvinodsa

Updated 3 months ago

go-iam api server images

Image
Security
Developer tools
0

2.0K

melvinodsa/go-iam repository overview

go-iam

codecov Go Report Card GoDoc

go-iam is a lightweight, multi-tenant Identity and Access Management (IAM) server built in Golang. It provides robust authentication and fine-grained authorization for modern applications. With support for custom roles, third-party auth providers, and multi-client setups, go-iam gives you full control over access management in a scalable and modular way.

✅ Admin UI: go-iam-ui
🐳 Docker Setup: go-iam-docker
🔐 Backend: go-iam
📦 SDK: go-iam-sdk
🚀 Examples: go-iam-examples 💬 Reddit Community: r/GoIAM

go-iam overview

✨ Features

🔀 Multi-Tenancy
  • Create and manage Projects
  • Strict isolation of data between tenants
🔐 Authentication Provider Integration
  • Google, Microsoft, GitHub OAuth login support
  • Easily extendable to add more providers
  • Shared credentials support across multiple clients
🧩 Client Management
  • Multiple apps (clients) per project
  • Avoid duplicate OAuth credentials
🧱 Role-Based Access Control (RBAC)
  • Define resources and group them into roles
  • Create custom roles and assign to users
  • Granular access control for different actions/resources
🛠️ Admin UI
  • React-based Admin interface for managing:
    • Projects
    • Users
    • Roles
    • Resources
    • Clients

🧰 Tech Stack

ComponentTech
BackendGolang
DatabaseMongoDB
Caching (opt)Redis
FrontendReact + Vite (PNPM)

🚀 Getting Started

Option 1: 🔧 Manual Setup (Development)
Prerequisites
  • Go 1.21+
  • MongoDB
  • Redis (optional, recommended)
  • Google OAuth Credentials
Run the Backend
git clone https://github.com/melvinodsa/go-iam.git
cd go-iam
cp sample.env .env
go run main.go

Use the official go-iam-docker repo to spin up everything with Docker Compose, including:

  • MongoDB
  • Redis
  • go-iam (backend)
  • go-iam-ui (admin frontend)
Steps
git clone https://github.com/melvinodsa/go-iam-docker.git
cd go-iam-docker
cp sample.env .env
docker compose up -d
Access

📦 Environment Variables

Some important environment variables used in .env:

VariableDescription
LOGGER_LEVELLogger level 1 - Debug (refer., https://docs.gofiber.io/api/log/)
DB_HOSTMongoDB URI (e.g., mongodb://user:pass@host/db)
JWT_SECRETSecret key used for generating and verifying JWT tokens
REDIS_HOST, REDIS_PASSWORD, ENABLE_REDISRedis host address and toggle to enable Redis caching
ENCRYPTER_KEYOptional symmetric key for encrypting sensitive fields - change this
AUTH_PROVIDER_REFETCH_INTERVAL_IN_MINUTESInterval in minutes to refetch and sync third-party auth providers
TOKEN_CACHE_TTL_IN_MINUTESInterval for which the authentication token should be valid

License

Tag summary

Content type

Image

Digest

sha256:67d29db1a

Size

18.5 MB

Last updated

3 months ago

docker pull melvinodsa/go-iam