Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6936141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:11:43+00:00 2026-05-27T12:11:43+00:00

I have added the Authentication attribute on controller classes which are for admin purposes

  • 0

I have added the Authentication attribute on controller classes which are for admin purposes like adding, removing categories and product. All such controllers(ManageCategory, ManageProduct) are decorated with following :-

[Authorize(Roles = "Administrator")]

These controllers have Upload and Remove action methods which are invoked by jquery from the rendered view. Since client script don’t use the URL or postback, I am bit skeptical if someone can bypass the controller authorization. These action methods are very sensitive because it provides the ability to remove a file on server. Following is the code from Remove action method.

[HttpPost]
public ActionResult Remove(string fileName)
{
    string completFileName = Server.MapPath("~" + fileName);
    System.IO.File.Delete(completFileName);
    return Json(true);
}

Though this action method resides in a Controller with Authorization, Can someone still reach it without logging-in. Should i be worried and do something else or one will always need to be authorized as administrator before accessing this ?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:11:44+00:00Added an answer on May 27, 2026 at 12:11 pm

    I’m not sure what you mean by..

    Since client script don’t use the URL or postback

    AJAX requests from client script send cookies just the same as regular page requests – have a look at the headers of an AJAX request using Firebug or Fiddler or some such tool.

    This includes the .ASPXAUTH cookie which standard ASP.NET authentication uses. The controller will perform exactly the same authentication checks on an AJAX request as it would on a normal page request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added some code which compiles cleanly and have just received this Windows
I have added a custom action to the CustomList type. For testing purposes I
I have added a new job in my hudson server which builds the project
I have added the following configuration section to my web.config file <security> <authentication> <anonymousAuthentication
I have added Two Factor Authentication to my Mobile ASP.Net Web App. When the
I have added username to a devise authentication setup, and for some reason, it's
I have an MVC 3 application which uses asp.net authentication. I have just created
I have created an MVC3 application and added cutomerrors attribute on in web.config. It
My ASP.NET site is using Integrated Authentication with impersonation turned off. I have added
I implemented an authentication system using authlogic, and have added password reset functionality as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.