{"id":26152779,"url":"https://github.com/angelodotnet/identitymanager","last_synced_at":"2025-03-11T07:21:52.201Z","repository":{"id":280020446,"uuid":"935748592","full_name":"AngeloDotNet/IdentityManager","owner":"AngeloDotNet","description":"Example showing a management of users, roles, permissions, modules and licenses using .NET 8 Minimal API and Entity Framework Core","archived":false,"fork":false,"pushed_at":"2025-03-05T08:07:34.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T06:07:06.012Z","etag":null,"topics":[],"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/AngeloDotNet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-02-20T00:34:07.000Z","updated_at":"2025-03-05T08:07:38.000Z","dependencies_parsed_at":"2025-02-28T22:44:37.578Z","dependency_job_id":"a20e96f7-97d4-4fb9-a6bd-bbaac899f6d4","html_url":"https://github.com/AngeloDotNet/IdentityManager","commit_stats":null,"previous_names":["angelodotnet/identitymanager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FIdentityManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FIdentityManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FIdentityManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FIdentityManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngeloDotNet","download_url":"https://codeload.github.com/AngeloDotNet/IdentityManager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242989230,"owners_count":20217746,"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":[],"created_at":"2025-03-11T07:21:51.778Z","updated_at":"2025-03-11T07:21:52.179Z","avatar_url":"https://github.com/AngeloDotNet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Identity Manager\n\nExample showing a management of users, roles, permissions, modules and licenses using .NET 8 Minimal API and Entity Framework Core\n\n\u003e [!IMPORTANT]\n\u003e **The MinimalApi.Identity.API library used in this sample project, is still under development of new implementations.**\n\n### 🛠️ Installation\n\nThis example uses the MinimalApi.Identity.API library available on NuGet.\n\nJust search for MinimalApi.Identity.API in the Package Manager GUI or run the following command in the .NET CLI:\n\n```shell\ndotnet add package MinimalApi.Identity.API\n```\n\n### 🚀 Configuration\n\nAdding this sections in the _appsettings.json_ file:\n\n```json\n{\n    \"Kestrel\": {\n        \"Limits\": {\n            \"MaxRequestBodySize\": 5242880\n        }\n    },\n    \"JwtOptions\": {\n        \"Issuer\": \"[ISSUER]\",\n        \"Audience\": \"[AUDIENCE]\",\n        \"SecurityKey\": \"[SECURITY-KEY]\",\n    },\n    \"NetIdentityOptions\": {\n        \"RequireUniqueEmail\": true,\n        \"RequireDigit\": true,\n        \"RequiredLength\": 8,\n        \"RequireUppercase\": true,\n        \"RequireLowercase\": true,\n        \"RequireNonAlphanumeric\": true,\n        \"RequiredUniqueChars\": 4,\n        \"RequireConfirmedEmail\": true,\n        \"MaxFailedAccessAttempts\": 3,\n        \"AllowedForNewUsers\": true,\n        \"DefaultLockoutTimeSpan\": \"00:05:00\"\n    },\n    \"SmtpOptions\": {\n        \"Host\": \"smtp.example.org\",\n        \"Port\": 25,\n        \"Security\": \"StartTls\",\n        \"Username\": \"Username del server SMTP\",\n        \"Password\": \"Password del server SMTP\",\n        \"Sender\": \"MyApplication \u003cnoreply@example.org\u003e\",\n        \"SaveEmailSent\": false \n    },\n    \"UsersOptions\": {\n        \"AssignAdminRoleOnRegistration\": \"admin@example.org\"\n    },\n    \"ConnectionStrings\": {\n        \"DefaultConnection\": \"Data Source=[HOSTNAME];Initial Catalog=[DATABASE];User ID=[USERNAME];Password=[PASSWORD];Encrypt=False\"\n    }\n}\n```\n\n\u003e **Note**: If SaveEmailSent is false, only emails that failed while sending will be saved, if SaveEmailSent is true, both emails that were sent successfully and emails that failed will be saved\n\nRegistering services at _Program.cs_ file:\n\n```csharp\nvar builder = WebApplication.CreateBuilder(args);\nvar connectionString = builder.Configuration.GetDatabaseConnString(\"DefaultConnection\");\n\n//...\n\nvar jwtOptions = builder.Configuration.GetSettingsOptions\u003cJwtOptions\u003e(nameof(JwtOptions));\nvar identityOptions = builder.Configuration.GetSettingsOptions\u003cNetIdentityOptions\u003e(nameof(NetIdentityOptions));\nvar smtpOptions = builder.Configuration.GetSettingsOptions\u003cSmtpOptions\u003e(nameof(SmtpOptions));\n\nbuilder.Services\n    .AddRegisterServices\u003cProgram\u003e(connectionString, jwtOptions, identityOptions)\n    .AddAuthorization(options =\u003e\n    {\n        options.AddDefaultAuthorizationPolicy(); // Adds default authorization policies\n        // Here you can add additional authorization policies\n    });\n\nbuilder.Services\n    .AddSwaggerConfiguration()\n    .AddRegisterOptions(builder.Configuration);\n\nvar app = builder.Build();\n\n//...\n\napp.UseAuthentication();\napp.UseAuthorization();\n\n//...\n\napp.UseMapEndpoints();\napp.Run();\n```\n\n### 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n### ⭐ Give a Star\n\nIf you find this project useful, please give it a ⭐ on GitHub to show your support and help others discover it!\n\n### 🤝 Contributing\n\nSuggestions are always welcome! Feel free to open suggestion issues in the repository and we will implement them as possible.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelodotnet%2Fidentitymanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangelodotnet%2Fidentitymanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelodotnet%2Fidentitymanager/lists"}