go-iam

command module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

README ΒΆ

go-iam

codecov Go Report Card GoDoc Mentioned in Awesome Go

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

Component Tech
Backend Golang
Database MongoDB
Caching (opt) Redis
Frontend React + 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:

Variable Description
LOGGER_LEVEL Logger level 1 - Debug (refer., https://docs.gofiber.io/api/log/)
DB_HOST MongoDB URI (e.g., mongodb://user:pass@host/db)
JWT_SECRET Secret key used for generating and verifying JWT tokens
REDIS_HOST, REDIS_PASSWORD, ENABLE_REDIS Redis host address and toggle to enable Redis caching
ENCRYPTER_KEY Optional symmetric key for encrypting sensitive fields - change this
AUTH_PROVIDER_REFETCH_INTERVAL_IN_MINUTES Interval in minutes to refetch and sync third-party auth providers
TOKEN_CACHE_TTL_IN_MINUTES Interval for which the authentication token should be valid

License

  • Community Edition: Apache 2.0 (Open Source, free to use)

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
Package config provides configuration management for the Go IAM API server.
Package config provides configuration management for the Go IAM API server.
db
Package db provides database abstraction layer for MongoDB operations.
Package db provides database abstraction layer for MongoDB operations.
models
Package models provides database model definitions and access patterns for the Go IAM system.
Package models provides database model definitions and access patterns for the Go IAM system.
Package middlewares provides utility functions for extracting and managing authentication and authorization metadata from request contexts.
Package middlewares provides utility functions for extracting and managing authentication and authorization metadata from request contexts.
auth
Package auth provides authentication middleware for the Go IAM system.
Package auth provides authentication middleware for the Go IAM system.
projects
Package projects provides project-based access control middleware for the Go IAM system.
Package projects provides project-based access control middleware for the Go IAM system.
Package providers manages dependency injection and initialization for the Go IAM system.
Package providers manages dependency injection and initialization for the Go IAM system.
me
Package sdk provides client types and structures for the Go IAM API.
Package sdk provides client types and structures for the Go IAM API.
services
jwt