{"id":20632321,"url":"https://github.com/codybartfast/hello-github-oauth","last_synced_at":"2026-05-19T05:38:20.995Z","repository":{"id":91209209,"uuid":"594409193","full_name":"codybartfast/hello-github-oauth","owner":"codybartfast","description":"Hello GitHub OAuth","archived":false,"fork":false,"pushed_at":"2023-02-06T08:44:56.000Z","size":928,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T21:39:08.217Z","etag":null,"topics":["asp-net","asp-net-core","asp-net-core-7","github","github-oauth","oath"],"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/codybartfast.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-01-28T13:18:00.000Z","updated_at":"2024-12-26T18:21:20.000Z","dependencies_parsed_at":"2023-07-10T00:46:33.254Z","dependency_job_id":null,"html_url":"https://github.com/codybartfast/hello-github-oauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codybartfast/hello-github-oauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybartfast%2Fhello-github-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybartfast%2Fhello-github-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybartfast%2Fhello-github-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybartfast%2Fhello-github-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codybartfast","download_url":"https://codeload.github.com/codybartfast/hello-github-oauth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybartfast%2Fhello-github-oauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021378,"owners_count":26087023,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["asp-net","asp-net-core","asp-net-core-7","github","github-oauth","oath"],"created_at":"2024-11-16T14:15:47.057Z","updated_at":"2025-10-14T21:39:08.416Z","avatar_url":"https://github.com/codybartfast.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello GitHub OAuth\n\nThis is a 'Hello World' app to demonstrate a minimal working connection with GitHub OAuth for an ASP.NET Core 7.0 application (specifically v7.0.102).\n\nThis web app is based on the article [Add GitHub OpenID Auth For ASP.NET Core Apps][article] by Khalid Abuhakmeh which uses ASP.NET Core 5.0.\n\nThis app only claims access to public information for an account so I believe I can include the ClientSecret below without putting anybody's personal data at risk. However, if you do use the Client details below to authorize this app with your GitHub account I would still recommend you revoke access afterwards by going to [GitHub Settings](https://github.com/settings/applications) and revoking access for \"Hello GitHub OAuth\".\n\n## Expected Behaviour\n\n* Click on \"my secret\" on the homepage.  \n* You should be presented with Authentication page with a \"Sign in using GitHub\" button.\n* After clicking on the button you will be asked if you want to \"Authorise Hello GitHub OAuth\" with a green \"Authorize codybartfast\" button.\n* If you authorize the app you should be redirected to the 'secret' page.\n\n## To Run This App Using My GitHub OAuth Registration\n\nTo authenticate using my OAuth registration run the following commands in the application root:\n\n```lang-powershell\ndotnet user-secrets set github:clientId \"75dfc8f5ff877ffce7f2\" --project HelloGithubOAuth.csproj\ndotnet user-secrets set github:clientSecret \"92a33c17e7c8c87ab69d0f63a66059b2daef8f84\" --project HelloGithubOAuth.csproj\n```\n\n## To Run This App Using Your Own GitHub OAuth Registration\n\nVisit [GitHub Developer Settings](https://github.com/settings/applications/new) to register a new OAuth application. Use `http://localhost:5291/` as the 'Homepage URL' and `http://localhost:5291/signin-github` as the 'Authorized callback URL'.  After registering your application you can view the 'Client ID'  of your registration and can create a Client Secret.  Configure the App to use your details using:\n\n```lang-powershell\ndotnet user-secrets set github:clientId \"\u003cyour client id\u003e\" --project HelloGithubOAuth.csproj\ndotnet user-secrets set github:clientSecret \"\u003cyour client secret\u003e\" --project HelloGithubOAuth.csproj\n```\n\n## To Add GitHub OAuth To an Existing App\n\nThe base of this application was created using these commands:\n\n```lang-powershell\ndotnet new webapp -n HelloGithubOAuth\nmv HelloGithubOAuth hello-github-oauth\ncd hello-github-oauth\n\ndotnet new page --name Signin --output Pages --namespace HelloGithubOAuth.Pages\ndotnet new page --name Secret --output Pages --namespace HelloGithubOAuth.Pages\ndotnet new gitignore\n```\n\n[This commit](https://github.com/codybartfast/hello-github-oauth/commit/2e0a2f05d5591e102ebf29fb8f09ad10aad33b1b) shows all the changes that were made to that base project to enable GitHub OAuth and add a secured ('secret') page.\n\nDo not use the same `UserSecretId` in your own project file. Instead use this command to add a new User Secrets Id _before_ setting the ClientId and ClientSecret user secrets.\n\n```lang-powershell\ndotnet user-secrets init --project \u003cYour Project Name\u003e.csproj\n```\n\nFor details see:\n\n* [Khalid Abuhakmeh's article][article]\n* [Stack Overflow](https://stackoverflow.com/questions/71740380/authentication-with-github-in-asp-net-core-6)\n\n[article]: https://khalidabuhakmeh.com/github-openid-auth-aspnet-core-apps\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodybartfast%2Fhello-github-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodybartfast%2Fhello-github-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodybartfast%2Fhello-github-oauth/lists"}