{"id":30520231,"url":"https://github.com/jzills/swaggeruiauthorization","last_synced_at":"2025-08-26T15:40:34.286Z","repository":{"id":236193085,"uuid":"645086498","full_name":"jzills/SwaggerUIAuthorization","owner":"jzills","description":"Control access to SwaggerUI, ensuring that only authenticated users with appropriate permissions can view documentation their roles have access to. This package leverages ASP.NET Core authentication and authorization mechanisms, aligning with the rules already established within your application.","archived":false,"fork":false,"pushed_at":"2024-11-20T03:13:00.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T11:26:32.493Z","etag":null,"topics":["authorization","authorization-middleware","swagger","swagger-ui","swashbuckle","swashbuckleaspnetcore"],"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/jzills.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":"2023-05-24T22:32:23.000Z","updated_at":"2025-01-29T02:02:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"15426f71-c461-4319-8070-3532465a9e47","html_url":"https://github.com/jzills/SwaggerUIAuthorization","commit_stats":null,"previous_names":["jzills/swaggeruiauthorization"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jzills/SwaggerUIAuthorization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzills%2FSwaggerUIAuthorization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzills%2FSwaggerUIAuthorization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzills%2FSwaggerUIAuthorization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzills%2FSwaggerUIAuthorization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jzills","download_url":"https://codeload.github.com/jzills/SwaggerUIAuthorization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jzills%2FSwaggerUIAuthorization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272234473,"owners_count":24897018,"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-08-26T02:00:07.904Z","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":["authorization","authorization-middleware","swagger","swagger-ui","swashbuckle","swashbuckleaspnetcore"],"created_at":"2025-08-26T15:40:32.088Z","updated_at":"2025-08-26T15:40:34.261Z","avatar_url":"https://github.com/jzills.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SwaggerUIAuthorization\n\n[![NuGet Version](https://img.shields.io/nuget/v/SwaggerUIAuthorization.svg)](https://www.nuget.org/packages/SwaggerUIAuthorization/) [![NuGet Downloads](https://img.shields.io/nuget/dt/SwaggerUIAuthorization.svg)](https://www.nuget.org/packages/SwaggerUIAuthorization/)\n\n## Summary\n\nIf your API endpoints require authentication and authorization, it makes sense to integrate those rules into your Swagger documentation. With the `SwaggerUIAuthorization` package, you can seamlessly control access to SwaggerUI, ensuring that only authenticated users with appropriate permissions can view documentation their roles have access to. This package leverages .NET's authentication and authorization mechanisms, aligning with the rules already established within your application.\n\n## Features\n\n- Authentication and authorization dependent rendering of swagger documentation\n- The same rules that .NET has defined for an `AuthorizeAttribute` applies\n    - Comma separated roles are evaluated on an OR basis\n    - Multiple `AuthorizeAttribute`'s are evaluated on an AND basis\n    - An `AllowAnonymousAttribute` bypasses all authorization\n\n## Limitations\n\nThe schema displayed at the bottom of an api using SwaggerUI is force hidden internally using the following code:\n    \n    options.DefaultModelsExpandDepth(-1);\n\n## Installation\n\n`SwaggerUIAuthorization` is available on [NuGet](https://www.nuget.org/packages/SwaggerUIAuthorization/). \n\n    dotnet add package SwaggerUIAuthorization\n\n## Docs\n\n[SwaggerUIAuthorization](src/README.md)\n\n## Examples\n\n[WebApiWithCustomLogin](samples/WebApiWithCustomLogin/README.md) \\\n[WebApiWithMicrosoftIdentity](samples/WebApiWithMicrosoftIdentity/README.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjzills%2Fswaggeruiauthorization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjzills%2Fswaggeruiauthorization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjzills%2Fswaggeruiauthorization/lists"}