{"id":22640881,"url":"https://github.com/aliencube/authorizeattribute.extended","last_synced_at":"2025-10-07T22:44:54.719Z","repository":{"id":27211500,"uuid":"30682402","full_name":"aliencube/AuthorizeAttribute.Extended","owner":"aliencube","description":"This provides a library separating 403 error from 401 error on the ASP.NET MVC AuthorizeAttribute class.","archived":false,"fork":false,"pushed_at":"2015-07-26T10:58:38.000Z","size":1216,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T06:18:44.923Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/aliencube.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}},"created_at":"2015-02-12T02:55:49.000Z","updated_at":"2020-10-06T09:20:13.000Z","dependencies_parsed_at":"2022-09-01T02:51:53.247Z","dependency_job_id":null,"html_url":"https://github.com/aliencube/AuthorizeAttribute.Extended","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FAuthorizeAttribute.Extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FAuthorizeAttribute.Extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FAuthorizeAttribute.Extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FAuthorizeAttribute.Extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliencube","download_url":"https://codeload.github.com/aliencube/AuthorizeAttribute.Extended/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487668,"owners_count":21112191,"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":"2024-12-09T04:14:43.644Z","updated_at":"2025-10-07T22:44:49.672Z","avatar_url":"https://github.com/aliencube.png","language":"C#","readme":"# AuthorizeAttribute Extended #\n\n**AuthorizeAttribute Extended** separates 403 (Forbidden) error code from 401 (Unauthorized) error code based on authentication and/or authorisation result, while ASP.NET's AuthorizeAttribute class only returns 401 (Unauthorized) error code.\n\n\n## Package Status ##\n\n* **AuthorizeAttribute Extended** [![](https://img.shields.io/nuget/v/Aliencube.AuthorizeAttribute.Extended.svg)](https://www.nuget.org/packages/Aliencube.AuthorizeAttribute.Extended/) [![](https://img.shields.io/nuget/dt/Aliencube.AuthorizeAttribute.Extended.svg)](https://www.nuget.org/packages/Aliencube.AuthorizeAttribute.Extended/)\n\n\n## Getting Started ##\n\n**AuthorizeAttribute Extended** works the exactly same as the existing `AuthorizeAttribute` class on [ASP.NET MVC](http://www.nuget.org/packages/Microsoft.AspNet.Mvc).\n\n\n### Add/Update `FilterConfig.cs` ###\n\n* `App_Start\\FilterConfig.cs` should include the `AuthorizeAttribute` class.\n* The `using` alias MUST be used to avoid confusion from the `System.Web.Mvc.AuthorizeAttribute` class.\n\n```csharp\nusing AuthorizeAttribute = Aliencube.AuthorizeAttribute.Extended.AuthorizeAttribute;\n...\n\npublic class FilterConfig\n{\n  public static void RegisterGlobalFilters(GlobalFilterCollection filters)\n  {\n    filters.Add(new AuthorizeAttribute());\n  }\n}\n```\n\n\n### Add/Update `Global.asax.cs` ###\n\n* `Global.asax.cs` should include the `FilterConfig` to activate the `AuthorizeAttribute` class.\n\n```csharp\n// Global.asax.cs\npublic class MvcApplication : System.Web.HttpApplication\n{\n  protected void Application_Start()\n  {\n    AreaRegistration.RegisterAllAreas();\n    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);\n    RouteConfig.RegisterRoutes(RouteTable.Routes);\n  }\n}\n```\n\n\n### Add/Update Controllers ###\n\n* The `using` alias MUST be used to avoid confusion from the `System.Web.Mvc.AuthorizeAttribute` class.\n\n```csharp\nusing AuthorizeAttribute = Aliencube.AuthorizeAttribute.Extended.AuthorizeAttribute;\n...\n\n[Authorize]\npublic partial class AccountController : Controller\n{\n  ...\n\n  [HttpPost]\n  [AllowAnonymous]\n  public virtual async Task\u003cActionResult\u003e Login(LoginViewModel model)\n  {\n    ...\n\n    return View();\n  }\n\n  [Authorize(Roles = \"User\")]\n  public virtual async Task\u003cActionResult\u003e MyProfile()\n  {\n    ...\n\n    return View();\n  }\n\n  ...\n}\n```\n\n## Contribution ##\n\nYour contributions are always welcome! All your work should be done in your forked repository. Once you finish your work, please send us a pull request onto our `dev` branch for review.\n\n\n## License ##\n\n**AuthorizeAttribute Extended** is released under [MIT License](http://opensource.org/licenses/MIT)\n\n\u003e The MIT License (MIT)\n\u003e\n\u003e Copyright (c) 2014 [aliencube.org](http://aliencube.org)\n\u003e \n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\u003e \n\u003e The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\u003e \n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencube%2Fauthorizeattribute.extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliencube%2Fauthorizeattribute.extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencube%2Fauthorizeattribute.extended/lists"}