{"id":28906862,"url":"https://github.com/skyblock-maniacs/auth","last_synced_at":"2026-04-30T07:37:50.415Z","repository":{"id":299575288,"uuid":"1003341137","full_name":"Skyblock-Maniacs/auth","owner":"Skyblock-Maniacs","description":"Skyblock Maniacs authentication service","archived":false,"fork":false,"pushed_at":"2025-06-17T07:56:35.000Z","size":14,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T08:36:54.959Z","etag":null,"topics":["authentication","discord","golang","oauth2","oauth2-server"],"latest_commit_sha":null,"homepage":"https://auth.sbm.gg/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Skyblock-Maniacs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-17T02:17:36.000Z","updated_at":"2025-06-17T08:13:02.000Z","dependencies_parsed_at":"2025-06-17T08:36:57.579Z","dependency_job_id":"2d011624-8578-46b1-984d-450ebd98e985","html_url":"https://github.com/Skyblock-Maniacs/auth","commit_stats":null,"previous_names":["skyblock-maniacs/auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Skyblock-Maniacs/auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyblock-Maniacs%2Fauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyblock-Maniacs%2Fauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyblock-Maniacs%2Fauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyblock-Maniacs%2Fauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Skyblock-Maniacs","download_url":"https://codeload.github.com/Skyblock-Maniacs/auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyblock-Maniacs%2Fauth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261143160,"owners_count":23115677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","discord","golang","oauth2","oauth2-server"],"created_at":"2025-06-21T15:10:20.216Z","updated_at":"2026-04-30T07:37:50.410Z","avatar_url":"https://github.com/Skyblock-Maniacs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛡️ Skyblock Maniacs Auth Service\nSkyblock Maniacs Auth service is a custom authentication service for the Skyblock Maniacs Discord server and its related web services.\nIt is built using Go, utilizing the [Gin](https://github.com/gin-gonic/gin) web framework for handling HTTP requests and responses. \nRelies on [MongoDB](https://www.mongodb.com/) \u0026 [Redis](https://redis.io/).\n\n### Live Instance\nYou can access the live instance of the Skyblock Maniacs Auth service at [auth.sbm.gg](https://auth.sbm.gg/).\n\n## 🚀 Features\n- [Discord OAuth2](https://discord.com/developers/docs/topics/oauth2#oauth2) authentication\n- [MC-Auth OAuth2](https://github.com/Mc-Auth-com/Mc-Auth) authentication\n- JWT token generation and validation\n- Permission management for authenticated users\n\n## Endpoints\n| Method | Endpoint | Description | Query Parameters | Cookies | Example |\n|--------|----------|-------------|------------------|---------| ------|\n| GET    | `/healthz` | Health check endpoint to verify if the service is running | - | - | https://auth.sbm.gg/healthz |\n| GET    | `/@me/permissions` | Retrieves the permissions of the authenticated user | - | `sbm_jwt`, `discord_refresh_token`, `discord_access_token` | https://auth.sbm.gg/@me/permissions |\n| GET    | `/discord/login` | Initiates Discord OAuth2 login flow | `redirect_uri` (optional) | - | https://auth.sbm.gg/discord/login?redirect_uri=https://sbm.gg |\n| GET    | `/discord/callback` | Callback endpoint for Discord OAuth2 login | `code` (required) | - | https://auth.sbm.gg/discord/callback?code=YOUR_CODE_HERE |\n| GET    | `/discord/refresh` | Refreshes the Discord OAuth2 token | `refresh_token` (required) | - | https://auth.sbm.gg/discord/refresh?refresh_token |\n| GET    | `/discord/logout` | Logs out the user from Discord and revokes sbm_jwt | - | - | https://auth.sbm.gg/discord/logout |\n| GET    | `/minecraft/login` | Initiates MC-Auth OAuth2 login flow | `redirect_uri` (optional) | - | https://auth.sbm.gg/minecraft/login?redirect_uri=https://sbm.gg |\n| GET    | `/minecraft/callback` | Callback endpoint for MC-Auth OAuth2 login | `code` (required) | - | https://auth.sbm.gg/minecraft/callback?code=YOUR_CODE_HERE |\n| GET    | `/minecraft/logout` | Logs out the user from MC-Auth and revokes mc_jwt | - | - | https://auth.sbm.gg/minecraft/logout |\n\n## ⚒️ Installation\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/Skyblock-Maniacs/auth.git\n   ```\n2. Navigate to the project directory:\n   ```bash\n    cd auth\n    ```\n3. Install dependencies:\n    ```bash\n    go mod tidy\n    ```\n4. Set up environment variables:\n    Create a `.env` file in the root directory with the following variables:\n    ```env\n    PORT=3000\n    JWT_SECRET=your_jwt_secret_key\n\n    DISCORD_GUILD_ID=your_discord_guild_id\n    DISCORD_CLIENT_ID=your_discord_client_id\n    DISCORD_CLIENT_SECRET=your_discord_client_secret\n    DISCORD_REDIRECT_URI=http://localhost:8080/callback\n\n    MCAUTH_CLIENT_ID=your_mc_auth_client_id\n    MCAUTH_CLIENT_SECRET=your_mc_auth_client_secret\n    MCAUTH_OAUTH_REDIRECT_URI=http://localhost:3000/minecraft/callback\n\n    MONGO_URI=mongodb://localhost:27017/your_database_name\n    MONGO_DATABASE=your_database_name\n\n    REDIS_HOST=your_redis_host\n    REDIS_PORT=your_redis_port\n    REDIS_PASSWORD=your_redis_password\n    REDIS_USER=\"default\"\n    ```\n    Optionally, you can use the [.env.example](./.env.example) file as a template with `cp .env.example .env`.\n5. Run the application:\n    ```bash\n    go run ./cmd/auth\n    ```\n6. Access the service:\n    Check the webservice is running at `http://localhost:3000/healthz`.\n\n## ⚠️ Deployment\nThis app is designed to be run in a Docker container. To deploy, use the provided [Dockerfile](./Dockerfile).\nThe live version of the app is hosted on [Skyblock Maniacs Auth](https://auth.sbm.gg/) using [Dokploy](https://dokploy.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyblock-maniacs%2Fauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyblock-maniacs%2Fauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyblock-maniacs%2Fauth/lists"}