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 9178751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:37:37+00:00 2026-06-17T17:37:37+00:00

I am protecting WebAPI using forms Authentication, that is using Breezecontroller When i try

  • 0

I am protecting WebAPI using forms Authentication, that is using Breezecontroller
When i try to call WebAPi method i am getting back the following error.

status:404
statusText: “Not Found”
message:”MetaData query failed for:”;, No Http resource was found tha matches…

My question is why am i not getting back “UnAuthorized error(401)” ?
metadata is decorated with [Authorize] as well.

Seems like FormsAuthentication’s redirect is giving problem.
It is redirecting to Login(has AllowAnonymous) WebApi method and reports it cannot find, eventhough i have. Also i am applying the Authrozie to the methods instead of controller. the exact error is

  {"$id":"1","$type":"System.Web.Http.HttpError,System.Web.Http","Message":"NoHTTPresourcewasfoundthatmatchestherequestURI'http://localhost:40678/api/Country/Login?ReturnUrl=/api/Country/Metadata'.","MessageDetail":"Noactionwasfoundonthecontroller'Country'thatmatchestherequest."}
  • 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-06-17T17:37:38+00:00Added an answer on June 17, 2026 at 5:37 pm

    Just tried and working fine. I’m betting you have a mistake in your URL.

    Here is the prelim to my controller:

    [Authorize]
    [BreezeController]
    public class BreezeTodoController : ApiController
    {
        private readonly BreezeTodoContext _context;
    
        public BreezeTodoController() {
            _context = new BreezeTodoContext(User);
        }
    
        [HttpGet]
        public string Metadata() {
            return _context.Metadata();
        }
        // ... more
    

    I hit it with this URL

    http://localhost:32377/api/breezetodox/metadata
    

    And I get back the 401

    Request URL:http://localhost:32377/api/breezetodo/metadata
    Request Method:GET
    Status Code:401 Unauthorized
    

    But if I make a mistake in the URL (see ‘x’ after breezetodo)

    Request URL:http://localhost:32377/api/breezetodox/metadata
    Request Method:GET
    Status Code:404 Not Found
    

    Same thing if my action name doesn’t match (see ‘x’ after metadata):

    Request URL:http://localhost:32377/api/breezetodo/metadatax
    Request Method:GET
    Status Code:404 Not Found
    

    In other words, HTTP can’t report that a resource is unauthorized if it can’t find that resource in the first place.

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

Sidebar

Related Questions

Hi I am using basic authentication method for protecting some pages in my Webapp.
I read in more than one website about this method of protecting forms: I
I am thinking of protecting some of my website's forms with some captchas. I
Is the following a secure way of protecting a user only area? if(!isset($_SESSION['username'])){redirect(SITE_ROOT .
I have to protect my code? which is the best method for protecting our
I want to know if password protecting areas of a website using sessions in
I am trying to implement a custom API authentication method as suggested below. Password
I've get an action in my Rails 3 app that I'm pw-protecting with authenticate_or_request_with_http_basic.
I am protecting my string using this code to insert it into the database:
I'm interested in a protecting of my web application by using generation a csrf

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.