{"id":16154798,"url":"https://github.com/dubyadude/oauthgate","last_synced_at":"2025-03-18T20:30:19.777Z","repository":{"id":167978580,"uuid":"616713919","full_name":"DubyaDude/OAuthGate","owner":"DubyaDude","description":"Protect a NGINX Site with Discord OAuth","archived":false,"fork":false,"pushed_at":"2024-12-25T17:55:33.000Z","size":41,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T12:04:16.801Z","etag":null,"topics":["discord","discord-oauth","discord-oauth2","nginx","nginx-configuration"],"latest_commit_sha":null,"homepage":"","language":"C#","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/DubyaDude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2023-03-20T23:43:25.000Z","updated_at":"2024-12-25T17:55:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6ecf65e-4f00-48f4-b92a-be37cf20a99f","html_url":"https://github.com/DubyaDude/OAuthGate","commit_stats":null,"previous_names":["dubyadude/nginx-discord-oauth-reverse-proxy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DubyaDude%2FOAuthGate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DubyaDude%2FOAuthGate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DubyaDude%2FOAuthGate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DubyaDude%2FOAuthGate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DubyaDude","download_url":"https://codeload.github.com/DubyaDude/OAuthGate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243949724,"owners_count":20373647,"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":["discord","discord-oauth","discord-oauth2","nginx","nginx-configuration"],"created_at":"2024-10-10T01:18:58.166Z","updated_at":"2025-03-18T20:30:19.484Z","avatar_url":"https://github.com/DubyaDude.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuthGate - A NGINX Discord OAuth Reverse Proxy\n\nThis project allows securing an NGINX reverse proxied site via Discord OAuth.\n\n## Setting up OAuthGate Process\n\n### appsettings.json\nConfigure the `appsettings.json` like so:\n```json\n\"DiscordOptions\": {\n  \"AuthCookieName\": \"APP_NAME_HERE-auth\",\n  \"Client\": {\n    \"Id\": 0,\n    \"Secret\": \"0\"\n  },\n  \"WhitelistedUsers\": [ 0, 1 ],\n  \"WhitelistedGuilds\": [ 0, 1 ],\n  \"WhitelistedRoles\": {\n      \"0\": [ 1, 2 ],\n      \"3\": [ 4, 5 ]\n    },\n  \"EmailHandling\":  \"None\"\n}\n```\n- AuthCookieName: The name of the Authentication Cookie.\n\n- Client.Id: The Client ID of the Discord Application.\n\n- Client.Secret: The Secret of the Discord Application.\n\n- WhitelistedUsers: Whitelisted Discord Discord User IDs.\n\n- WhitelistedGuilds: Whitelisted Discord Guild IDs. (They need to be part of the guild)\n\n- WhitelistedRoles: Whitelisted Discord Guild Role Ids. (They need to be part of the guild and have the role)\n\n- EmailHandling: How to handle email\n  - None: Do not ask for an email when calling Discord OAuth.\n  - Log: Ask for email when calling Discord OAuth.\n  - LogAndRequire: Ask for email when calling Discord OAuth and check that an email was given from the callback.\n\n**Whitelist Behaviour** - A user must be part of either Whitelisted Guilds, Whitelisted Roles, or Whitelisted Users if either one has a value. If all are null/empty, any Discord Login will be allowed.\n\n### Running on Different Port\nTo run the process on a specific port, start the OAuthGate project like so:\n```\n./OAuthGate --urls=https://localhost:7161\n```\n\n## Setting up NGINX Config\n\nUse the [nginx.conf](https://github.com/DubyaDude/nginx-discord-oauth-reverse-proxy/blob/master/nginx.conf) file in the root of the repo and replace any instance of `https://localhost:7161` if you end up using a different port.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubyadude%2Foauthgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdubyadude%2Foauthgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubyadude%2Foauthgate/lists"}