{"id":21813550,"url":"https://github.com/vahidn/aspnetcore2jwtauthentication","last_synced_at":"2025-05-16T06:00:23.580Z","repository":{"id":45863978,"uuid":"101897120","full_name":"VahidN/ASPNETCore2JwtAuthentication","owner":"VahidN","description":"Jwt Authentication without ASP.NET Core Identity","archived":false,"fork":false,"pushed_at":"2025-03-03T10:09:24.000Z","size":2444,"stargazers_count":301,"open_issues_count":1,"forks_count":105,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-19T10:18:22.637Z","etag":null,"topics":["asp-net-core","identity","json-web-token","jwt"],"latest_commit_sha":null,"homepage":"","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VahidN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.coffeete.ir/vnasiri","https://www.buymeacoffee.com/vahidn"]}},"created_at":"2017-08-30T15:18:00.000Z","updated_at":"2025-04-07T11:01:40.000Z","dependencies_parsed_at":"2024-09-15T01:28:42.031Z","dependency_job_id":"a1160475-ea59-403c-9cb9-658c74b113f0","html_url":"https://github.com/VahidN/ASPNETCore2JwtAuthentication","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VahidN%2FASPNETCore2JwtAuthentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VahidN%2FASPNETCore2JwtAuthentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VahidN%2FASPNETCore2JwtAuthentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VahidN%2FASPNETCore2JwtAuthentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VahidN","download_url":"https://codeload.github.com/VahidN/ASPNETCore2JwtAuthentication/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478160,"owners_count":22077675,"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":["asp-net-core","identity","json-web-token","jwt"],"created_at":"2024-11-27T14:29:55.642Z","updated_at":"2025-05-16T06:00:23.445Z","avatar_url":"https://github.com/VahidN.png","language":"SCSS","funding_links":["https://www.coffeete.ir/vnasiri","https://www.buymeacoffee.com/vahidn"],"categories":[],"sub_categories":[],"readme":"Jwt Authentication without ASP.NET Core Identity 9x\n===========\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/VahidN/ASPNETCore2JwtAuthentication\"\u003e\n     \u003cimg alt=\"GitHub Actions status\" src=\"https://github.com/VahidN/ASPNETCore2JwtAuthentication/workflows/.NET%20Core%20Build/badge.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n![jwtauth](/src/ASPNETCore2JwtAuthentication.WebApp/wwwroot/images/jwtauth.png)\n\nA Jwt based authentication sample for ASP.NET Core 9x without using the Identity system. It includes:\n\n- Users and Roles tables with a many-to-may relationship.\n- A separated EF Core data layer with enabled migrations.\n- An EF Core 9x based service layer.\n- A Db initializer to seed the default database values.\n- An account controller with Jwt and DB based login, custom logout and refresh tokens capabilities.\n- 2 sample API controllers to show how user-roles can be applied and used.\n- A Jwt validator service to show how to react to the server side changes to a user's info immediately.\n- [An Angular 7.0+ Client](/src/ASPNETCore2JwtAuthentication.AngularClient/). It contains:\n  - A JWT-based Login page.\n  - Handling how and where to store the tokens.\n  - How to handle refresh tokens mechanism, using reactive timers.\n  - How to validate the expiration date of a token.\n  - How to decode an access token and extract the user's roles from it.\n  - Authorizing access to a module via a route guard based on the user's roles.\n  - How to hide or display different parts of a page based on the user's roles.\n  - Adding a JWT token to the HTTP requests required authorized access automatically.\n  - Handling server side unauthorized errors automatically.\n\n\n\nHow to run the Angular 7.0+ Client\n-------------\n\n- Update all of the outdated global dependencies using the `npm update -g` command.\n- Install the `Angular-CLI`.\n- Open a command prompt console and then navigate to src/ASPNETCore2JwtAuthentication.AngularClient/ folder.\n- Now run the following commands:\n\n```PowerShell\nnpm update -g\nnpm install\n_2-ng-build-dev.bat\n```\n\n- Then open another command prompt console and navigate to src/ASPNETCore2JwtAuthentication.WebApp/ folder.\n- Now run the following commands:\n\n```PowerShell\ndotnet restore\ndotnet watch run\n```\n\n- Finally to browse the application, navigate to https://localhost:5001/AngularClient\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvahidn%2Faspnetcore2jwtauthentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvahidn%2Faspnetcore2jwtauthentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvahidn%2Faspnetcore2jwtauthentication/lists"}