{"id":22240176,"url":"https://github.com/mharikmert/dotnet-jwt-authentication","last_synced_at":"2026-05-01T10:32:11.848Z","repository":{"id":122958339,"uuid":"391057054","full_name":"mharikmert/dotnet-jwt-authentication","owner":"mharikmert","description":"Implementation of JWT authentication in .NET ","archived":false,"fork":false,"pushed_at":"2021-08-03T12:55:24.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T10:23:10.964Z","etag":null,"topics":["authentication","dotnet","jwt","token"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mharikmert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-07-30T12:28:19.000Z","updated_at":"2023-03-05T06:47:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"59cc2d76-13c6-4a7a-ae7c-519365ad99f0","html_url":"https://github.com/mharikmert/dotnet-jwt-authentication","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mharikmert/dotnet-jwt-authentication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mharikmert%2Fdotnet-jwt-authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mharikmert%2Fdotnet-jwt-authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mharikmert%2Fdotnet-jwt-authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mharikmert%2Fdotnet-jwt-authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mharikmert","download_url":"https://codeload.github.com/mharikmert/dotnet-jwt-authentication/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mharikmert%2Fdotnet-jwt-authentication/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32494270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["authentication","dotnet","jwt","token"],"created_at":"2024-12-03T03:29:07.769Z","updated_at":"2026-05-01T10:32:11.825Z","avatar_url":"https://github.com/mharikmert.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is JSON Web Token?\nJSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA.\n\nAlthough JWTs can be encrypted to also provide secrecy between parties, we will focus on signed tokens. Signed tokens can verify the integrity of the claims contained within it, while encrypted tokens hide those claims from other parties. When tokens are signed using public/private key pairs, the signature also certifies that only the party holding the private key is the one that signed it.\n\n## Structure of JWT \n![legacy-app-auth-5](https://user-images.githubusercontent.com/42295478/127875741-f7aa64fd-d44f-4272-9eed-ea28d2aff759.png)\n\n## Installation and Run \n```\n~$ git clone https://github.com/mharikmert/dotnet-jwt-authentication\n```\nIn the main directory; \n```\ndotnet-jwt-authentication~$ dotnet run\n```\nCheckout swagger UI -\u003e https://localhost:5001/swagger/index.html\n\n![swagger ui](https://user-images.githubusercontent.com/42295478/127877592-6b0ad0ff-92be-4a6a-a519-9259398405e7.png)\n\n### In memory users\n![in mem users](https://user-images.githubusercontent.com/42295478/127879997-ad2cdd1f-fa62-4622-b439-d254f5c7ae0c.png)\n\n## Authentication \nUser credentials are sent to ```api/auth``` endpoint in the request body. If the credentials are matched, user is authenticated and a Json Web Token is produced for the user.\nUser password assigned as null, and the token returns to the client in the response body. \n\n### Auth request with correct user credentials \n![auth request](https://user-images.githubusercontent.com/42295478/127878877-1319811f-266a-4c2d-9d16-dc23e56996ec.png)\n\n### Auth response and produced token\n![auth response ](https://user-images.githubusercontent.com/42295478/127878965-f5d73236-7878-4c18-87a4-b358da6e4b90.png)\n\n### Auth request with incorrect user credentials\n![wrong request](https://user-images.githubusercontent.com/42295478/127880572-c1c7bada-181b-402e-8755-0f88ec1c724a.png)\n\n### Auth response \n![bad reqeust](https://user-images.githubusercontent.com/42295478/127880636-c2d435a1-56d1-4b1c-9fde-728d56e3b24e.png)\n\n\n## Resources \nYou can checkout the official documentation of JWT for more information -\u003e https://jwt.io/introduction\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmharikmert%2Fdotnet-jwt-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmharikmert%2Fdotnet-jwt-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmharikmert%2Fdotnet-jwt-authentication/lists"}