Go IAM Examples
September 19, 2025 ยท View on GitHub
โ 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
This repository contains examples demonstrating how to integrate Go IAM authentication into applications using different programming languages and frameworks.
Overview
Go IAM is a comprehensive Identity and Access Management solution. This repository provides practical examples showing how to:
- Authenticate users with JWT tokens
- Validate tokens using the Go IAM SDK
- Retrieve user information
- Implement protected routes and middleware
- Handle authentication errors
Available Examples
๐ข Golang
Status: โ
Available
Framework: Fiber v2
Location: /golang
A complete example showing:
- JWT authentication middleware
- User information retrieval
- Protected HTTP endpoints
- HTTP client for testing
Quick Start: Navigate to the golang directory and follow the README for detailed setup instructions.
๐ข Node.js
Status: โ
Available
Framework: Express.js
SDK: @goiam/typescript
Location: /nodejs
A complete example showing:
- Official Go IAM SDK integration
- Express.js authentication middleware
- Type-safe JWT token validation
- RESTful API endpoints
- Modern async/await patterns
Quick Start: Navigate to the nodejs directory and follow the README for detailed setup instructions.
๐ข TypeScript
Status: โ
Available
Framework: Express.js
SDK: @goiam/typescript
Location: /typescript
A complete example showing:
- Full TypeScript support with strict type checking
- Official Go IAM SDK integration with type safety
- Strongly typed Express.js server and HTTP client
- Environment variable configuration
- Advanced TypeScript patterns and interfaces
Quick Start: Navigate to the typescript directory and follow the README for detailed setup instructions.
๐ข Python
Status: โ
Available
Framework: FastAPI
SDK: goiam-python (v0.0.1)
Location: /python
A complete example showing:
- FastAPI framework with dependency injection
- Official Go IAM SDK integration for Python
- Virtual environment setup with automated scripts
- Type hints and comprehensive error handling
- Interactive API documentation with Swagger UI
- Comprehensive testing and setup validation
Quick Start: Navigate to the python directory and run ./setup.sh for automated setup, or follow the README for manual setup instructions.
Coming Soon
We're working on examples for additional languages and frameworks:
๐ก Java
Status: ๐ง In Development
Framework: Spring Boot
Expected: Q2 2025
Prerequisites
Before using any example, ensure you have:
-
Go IAM Server: Set up and running
- Follow the setup guide: https://github.com/melvinodsa/go-iam-docker
- Server should be accessible at
http://localhost:3000
-
Development Environment:
- Appropriate runtime for your chosen language
- Package manager (go mod, npm, pip, etc.)
-
Valid Credentials:
- Client ID and Client Secret from Go IAM
- Access to Go IAM login interface
General Usage Pattern
All examples follow a similar pattern:
- Setup Go IAM Server - Use Docker setup
- Configure Credentials - Update client ID/secret in example code
- Obtain JWT Token - Login via Go IAM web interface and extract token from browser storage
- Run Server - Start the example application server
- Test Client - Use provided client code to test authentication
Project Structure
go-iam-examples/
โโโ README.md # This file - main documentation
โโโ golang/ # Golang examples
โ โโโ README.md # Golang-specific documentation
โ โโโ main.go # Main server application
โ โโโ client/ # HTTP client examples
โ โโโ go.mod # Dependencies
โโโ nodejs/ # Node.js examples
โ โโโ README.md # Node.js-specific documentation
โ โโโ server.js # Express.js server application
โ โโโ client/ # HTTP client examples
โ โโโ package.json # Dependencies and scripts
โโโ typescript/ # TypeScript examples
โ โโโ README.md # TypeScript-specific documentation
โ โโโ src/ # TypeScript source files
โ โ โโโ server.ts # Express.js server with full typing
โ โ โโโ client/ # HTTP client examples
โ โโโ dist/ # Compiled JavaScript (after build)
โ โโโ tsconfig.json # TypeScript configuration
โ โโโ package.json # Dependencies and scripts
โ โโโ .env.example # Environment variables template
โโโ python/ # Python examples
โ โโโ README.md # Python-specific documentation
โ โโโ server.py # FastAPI server application
โ โโโ client/ # HTTP client examples
โ โโโ requirements.txt # Python dependencies
โ โโโ venv/ # Virtual environment (after setup)
โ โโโ .env.example # Environment variables template
โโโ [future directories] # Additional language examples
Getting Started
- Choose Your Language: Navigate to the appropriate directory
- Read the Specific README: Each example has detailed setup instructions
- Follow Prerequisites: Ensure Go IAM server is running
- Run the Example: Follow the step-by-step guide in each directory
Support and Documentation
- Go IAM Docker Setup: https://github.com/melvinodsa/go-iam-docker
- Go IAM SDK Documentation: Check individual example directories for SDK usage
- Issues: Report problems in the respective example directories
Contributing
We welcome contributions! If you'd like to add examples for additional languages or frameworks:
- Create a new directory for your language/framework
- Follow the existing structure and documentation patterns
- Include a comprehensive README with setup instructions
- Add your example to this main README
License
This project follows the same license as the Go IAM project. Please refer to the main Go IAM repository for license details.
Note: This repository contains example code for demonstration purposes. For production use, ensure you follow security best practices and review the code according to your specific requirements.