Why does the Authorize annotation create a 404 error and not a 401 error? The Next CEO of Stack OverflowWhy does AuthorizeAttribute redirect to the login page for authentication and authorization failures?Authorize redirect 401 not workingSpring MVC AccessDeniedException 500 error received instead of custom 401 error for @PreAuthorized unauth requestsDebugging web application in service fabric - View error returns 404.NET Core 2.0 Authorization filter causes an internal errorGetting 404 error instead of 401, when token is expired or when token is not passed Asp.net core 2Authorization error (401) in .net core when calling api to api in windows authenticationJWT Authorization in .NET Core — 401 ErrorHow can I route 401 and 403 errors?Using multiple paginated lists on one HTML page

Is this a new Fibonacci Identity?

Can this transistor (2N2222) take 6 V on emitter-base? Am I reading the datasheet incorrectly?

How to coordinate airplane tickets?

Car headlights in a world without electricity

Direct Implications Between USA and UK in Event of No-Deal Brexit

Upgrading From a 9 Speed Sora Derailleur?

Gödel's incompleteness theorems - what are the religious implications?

How did scripture get the name bible?

What is the difference between 서고 and 도서관?

pgfplots: How to draw a tangent graph below two others?

Is it possible to make a 9x9 table fit within the default margins?

Find the majority element, which appears more than half the time

Find a path from s to t using as few red nodes as possible

What does this strange code stamp on my passport mean?

Is it correct to say moon starry nights?

What difference does it make matching a word with/without a trailing whitespace?

Can I cast Thunderwave and be at the center of its bottom face, but not be affected by it?

Why was Sir Cadogan fired?

My boss doesn't want me to have a side project

Can Sri Krishna be called 'a person'?

What did the word "leisure" mean in late 18th Century usage?

Why did early computer designers eschew integers?

Prodigo = pro + ago?

Can a PhD from a non-TU9 German university become a professor in a TU9 university?



Why does the Authorize annotation create a 404 error and not a 401 error?



The Next CEO of Stack OverflowWhy does AuthorizeAttribute redirect to the login page for authentication and authorization failures?Authorize redirect 401 not workingSpring MVC AccessDeniedException 500 error received instead of custom 401 error for @PreAuthorized unauth requestsDebugging web application in service fabric - View error returns 404.NET Core 2.0 Authorization filter causes an internal errorGetting 404 error instead of 401, when token is expired or when token is not passed Asp.net core 2Authorization error (401) in .net core when calling api to api in windows authenticationJWT Authorization in .NET Core — 401 ErrorHow can I route 401 and 403 errors?Using multiple paginated lists on one HTML page










0















Just curious. I'm trying to make a dynamic error page instead of a different error page for each error in my .NET Core Razor Pages app. I'm adding [Authorize(Roles="teamleader")] to the appropriate controller but when I test it, the inspector tells me that it's a 404 - Not Found error and not a 401 - Unauthorized error. Anyone know why? Do you need to see some code?










share|improve this question

















  • 2





    It's hard to tell with so little information, but my guess here is that it's redirecting you to something like /Account/Login and it's that URL that 404s.

    – Kirk Larkin
    Mar 7 at 22:13











  • check your web browser network tab to see the which request is 404.

    – Tao Zhou
    Mar 8 at 3:04















0















Just curious. I'm trying to make a dynamic error page instead of a different error page for each error in my .NET Core Razor Pages app. I'm adding [Authorize(Roles="teamleader")] to the appropriate controller but when I test it, the inspector tells me that it's a 404 - Not Found error and not a 401 - Unauthorized error. Anyone know why? Do you need to see some code?










share|improve this question

















  • 2





    It's hard to tell with so little information, but my guess here is that it's redirecting you to something like /Account/Login and it's that URL that 404s.

    – Kirk Larkin
    Mar 7 at 22:13











  • check your web browser network tab to see the which request is 404.

    – Tao Zhou
    Mar 8 at 3:04













0












0








0








Just curious. I'm trying to make a dynamic error page instead of a different error page for each error in my .NET Core Razor Pages app. I'm adding [Authorize(Roles="teamleader")] to the appropriate controller but when I test it, the inspector tells me that it's a 404 - Not Found error and not a 401 - Unauthorized error. Anyone know why? Do you need to see some code?










share|improve this question














Just curious. I'm trying to make a dynamic error page instead of a different error page for each error in my .NET Core Razor Pages app. I'm adding [Authorize(Roles="teamleader")] to the appropriate controller but when I test it, the inspector tells me that it's a 404 - Not Found error and not a 401 - Unauthorized error. Anyone know why? Do you need to see some code?







razor asp.net-core authorization






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 19:53









athomasathomas

397




397







  • 2





    It's hard to tell with so little information, but my guess here is that it's redirecting you to something like /Account/Login and it's that URL that 404s.

    – Kirk Larkin
    Mar 7 at 22:13











  • check your web browser network tab to see the which request is 404.

    – Tao Zhou
    Mar 8 at 3:04












  • 2





    It's hard to tell with so little information, but my guess here is that it's redirecting you to something like /Account/Login and it's that URL that 404s.

    – Kirk Larkin
    Mar 7 at 22:13











  • check your web browser network tab to see the which request is 404.

    – Tao Zhou
    Mar 8 at 3:04







2




2





It's hard to tell with so little information, but my guess here is that it's redirecting you to something like /Account/Login and it's that URL that 404s.

– Kirk Larkin
Mar 7 at 22:13





It's hard to tell with so little information, but my guess here is that it's redirecting you to something like /Account/Login and it's that URL that 404s.

– Kirk Larkin
Mar 7 at 22:13













check your web browser network tab to see the which request is 404.

– Tao Zhou
Mar 8 at 3:04





check your web browser network tab to see the which request is 404.

– Tao Zhou
Mar 8 at 3:04












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051832%2fwhy-does-the-authorize-annotation-create-a-404-error-and-not-a-401-error%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051832%2fwhy-does-the-authorize-annotation-create-a-404-error-and-not-a-401-error%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко