{"id":16557136,"url":"https://github.com/madeyoga/authendpoints","last_synced_at":"2025-03-16T20:30:23.347Z","repository":{"id":36957760,"uuid":"482293252","full_name":"madeyoga/AuthEndpoints","owner":"madeyoga","description":"A simple jwt library for Asp.Net 6 that provides a set of minimal api endpoints to handle authentication actions","archived":false,"fork":false,"pushed_at":"2023-10-14T12:18:48.000Z","size":1659,"stargazers_count":122,"open_issues_count":8,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-27T11:29:28.268Z","etag":null,"topics":["2fa","aspnetcore","authentication","authorization","csharp","dotnet6","httponly-cookie","json-web-token","jwt","spa"],"latest_commit_sha":null,"homepage":"https://madeyoga.github.io/AuthEndpoints/","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/madeyoga.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-16T15:40:25.000Z","updated_at":"2024-04-08T19:29:22.000Z","dependencies_parsed_at":"2024-10-11T20:06:39.015Z","dependency_job_id":"c4ce3b6a-0b8f-462a-aedd-c9ad43b4b58d","html_url":"https://github.com/madeyoga/AuthEndpoints","commit_stats":{"total_commits":391,"total_committers":3,"mean_commits":"130.33333333333334","dds":0.07928388746803072,"last_synced_commit":"09c30aa0342a5a2831e72936f1bd5f9a39eb397c"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeyoga%2FAuthEndpoints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeyoga%2FAuthEndpoints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeyoga%2FAuthEndpoints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeyoga%2FAuthEndpoints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madeyoga","download_url":"https://codeload.github.com/madeyoga/AuthEndpoints/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826798,"owners_count":20354221,"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":["2fa","aspnetcore","authentication","authorization","csharp","dotnet6","httponly-cookie","json-web-token","jwt","spa"],"created_at":"2024-10-11T20:06:37.096Z","updated_at":"2025-03-16T20:30:22.906Z","avatar_url":"https://github.com/madeyoga.png","language":"C#","readme":"# AuthEndpoints\n[![nuget](https://img.shields.io/nuget/v/AuthEndpoints?label=version\u0026logo=NuGet\u0026style=flat-square)](https://www.nuget.org/packages/AuthEndpoints/)\n[![issues](https://img.shields.io/github/issues/madeyoga/AuthEndpoints?color=blue\u0026logo=github\u0026style=flat-square)](https://github.com/madeyoga/AuthEndpoints/issues)\n[![downloads](https://img.shields.io/nuget/dt/AuthEndpoints?color=blue\u0026style=flat-square\u0026logo=nuget)](https://www.nuget.org/packages/AuthEndpoints/)\n![workflow](https://github.com/madeyoga/AuthEndpoints/actions/workflows/dotnet.yml/badge.svg)\n[![CodeFactor](https://www.codefactor.io/repository/github/madeyoga/authendpoints/badge)](https://www.codefactor.io/repository/github/madeyoga/authendpoints)\n[![license](https://img.shields.io/github/license/madeyoga/AuthEndpoints?color=blue\u0026style=flat-square\u0026logo=github)](https://github.com/madeyoga/AuthEndpoints/blob/main/LICENSE)\n\nA simple jwt authentication library for ASP.Net 6. AuthEndpoints library provides a set of minimal api endpoints to handle basic web \u0026 JWT authentication actions such as registration, email verification, reset password, create jwt, etc. It works with [custom identity user model](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/customize-identity-model?view=aspnetcore-6.0#custom-user-data).\n\n![swagger_authendpoints](https://i.imgur.com/rqMbFNy.png)\n\n## Supported endpoints\n- Users API:\n  - sign-up\n  - email verification\n  - user profile (retrieving)\n  - reset password\n  - change password\n  - enable 2fa\n  - login 2fa\n- TokenAuth:\n  - Create (login)\n  - Destroy (logout)\n- Simple JWT:\n  - Create (login)\n  - Refresh\n  - Verify\n\n## Current limitations\n- Only works with IdentityUser \u0026 EfCore\n- 2fa via email\n\n## Installing via NuGet\nThe easiest way to install AuthEndpoints is via [NuGet](https://www.nuget.org/packages/AuthEndpoints.MinimalApi/)\n\nInstall the library using the following .net cli command:\n\n```\ndotnet add package AuthEndpoints\n```\n\nor in Visual Studio's Package Manager Console, enter the following command:\n\n```\nInstall-Package AuthEndpoints\n```\n\n## Quick start\n\n```cs\n// MyDbContext.cs\n\n\nusing AuthEndpoints.SimpleJwt.Core.Models;\n\npublic class MyDbContext : IdentityDbContext\n{\n  public DbSet\u003cRefreshToken\u003e? RefreshTokens { get; set; } // \u003c--\n  public MyDbContext(DbContextOptions\u003cMyDbContext\u003e options) : base(options) { }\n}\n```\n\nAdd migration and apply migration:\n\n```\n// using dotnet cli\n$ dotnet ef migrations add CreateRefreshToken\n$ dotnet ef database update\n\n// or using package manager console in visual studio\nPM\u003e Add-Migration CreateRefreshToken\nPM\u003e Update-Database\n```\n\nAdd endpoints and call `app.MapEndpoints()` before `app.Run();`\n\n```cs\n// Program.cs\n\n\n// Required services\nbuilder.Services.AddIdentityCore\u003cIdentityUser\u003e(); // \u003c--\n\n// Add core services \u0026 users api\nbuilder.Services.AddAuthEndpointsCore\u003cIdentityUser, MyDbContext\u003e() // \u003c--\n                .AddUsersApiEndpoints()\n                .Add2FAEndpoints();\n\n// Add jwt endpoints\n// When no options are provided\n// AuthEndpoints will create a secret key and use a single security key (symmetric encryption)\n// for each access jwt and refresh jwt.\n// Secrets will be created under `keys/` directory.\nbuilder.Services.AddSimpleJwtEndpoints\u003cIdentityUser, MyDbContext\u003e(); // \u003c--\n\nvar app = builder.Build();\n\n...\n\napp.UseAuthentication(); // \u003c--\napp.UseAuthorization(); // \u003c--\n\n...\n\napp.MapEndpoints(); // \u003c--\n\napp.Run();\n```\n\n## Documentations\nDocumentation is available at [https://madeyoga.github.io/AuthEndpoints/](https://madeyoga.github.io/AuthEndpoints/) and in [docs](https://github.com/madeyoga/AuthEndpoints/tree/main/docs) directory.\n\n## Contributing\nYour contributions are always welcome! simply send a pull request! The [up-for-grabs](https://github.com/madeyoga/AuthEndpoints/labels/up-for-grabs) label is a great place to start. If you find a flaw, please open an issue or a PR and let's sort things out.\n\nThe project is far from perfect so every bit of help is more than welcome.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeyoga%2Fauthendpoints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadeyoga%2Fauthendpoints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeyoga%2Fauthendpoints/lists"}