Unauthorized access error message

Как исправить ошибку сервера 401 Unauthorized (Отказ в доступе): пошаговая инструкция. Причины появления ошибки 401. Как устранить проблему со стороны и клиента и владельца сайта.

Появление сообщения об ошибке 401 Unauthorized Error («отказ в доступе») при открытии страницы сайта означает неверную авторизацию или аутентификацию пользователя на стороне сервера при обращении к определенному url-адресу. Чаще всего она возникает при ошибочном вводе имени и/или пароля посетителем ресурса при входе в свой аккаунт. Другой причиной являются неправильные настройки, допущенные при администрировании web-ресурса. Данная ошибка отображается в браузере в виде отдельной страницы с соответствующим описанием. Некоторые разработчики интернет-ресурсов, в особенности крупных порталов, вводят собственную дополнительную кодировку данного сбоя:

  • 401 Unauthorized;
  • Authorization Required;
  • HTTP Error 401 – Ошибка авторизации.

Попробуем разобраться с наиболее распространенными причинами возникновения данной ошибки кода HTTP-соединения и обсудим способы их решения.

Причины появления ошибки сервера 401 и способы ее устранения на стороне пользователя

При доступе к некоторым сайтам (или отдельным страницам этих сайтов), посетитель должен пройти определенные этапы получения прав:

  1. Идентификация – получение вашей учетной записи («identity») по username/login или email.
  2. Аутентификация («authentic») – проверка того, что вы знаете пароль от этой учетной записи.
  3. Авторизация – проверка вашей роли (статуса) в системе и решение о предоставлении доступа к запрошенной странице или ресурсу на определенных условиях.

Большинство пользователей сохраняют свои данные по умолчанию в истории браузеров, что позволяет быстро идентифицироваться на наиболее часто посещаемых страницах и синхронизировать настройки между устройствами. Данный способ удобен для серфинга в интернете, но может привести к проблемам с безопасностью доступа к конфиденциальной информации. При наличии большого количества авторизованных регистрационных данных к различным сайтам используйте надежный мастер-пароль, который закрывает доступ к сохраненной в браузере информации.

Наиболее распространенной причиной появления ошибки с кодом 401 для рядового пользователя является ввод неверных данных при посещении определенного ресурса. В этом и других случаях нужно попробовать сделать следующее:

  1. Проверьте в адресной строке правильность написания URL. Особенно это касается перехода на подстраницы сайта, требующие авторизации. Введите правильный адрес. Если переход на страницу осуществлялся после входа в аккаунт, разлогинитесь, вернитесь на главную страницу и произведите повторный вход с правильными учетными данными.
  2. При осуществлении входа с сохраненными данными пользователя и появлении ошибки сервера 401 проверьте их корректность в соответствующих настройках данного браузера. Возможно, авторизационные данные были вами изменены в другом браузере. Также можно очистить кэш, удалить cookies и повторить попытку входа. При удалении истории браузера или очистке кэша потребуется ручное введение логина и пароля для получения доступа. Если вы не помните пароль, пройдите процедуру восстановления, следуя инструкциям.
  3. Если вы считаете, что вводите правильные регистрационные данные, но не можете получить доступ к сайту, обратитесь к администратору ресурса. В этом случае лучше всего сделать скриншот проблемной страницы.
  4. Иногда блокировка происходит на стороне провайдера, что тоже приводит к отказу в доступе и появлению сообщения с кодировкой 401. Для проверки можно попробовать авторизоваться на том же ресурсе с альтернативного ip-адреса (например, используя VPN). При подтверждении блокировки трафика свяжитесь с провайдером и следуйте его инструкциям.

Некоторые крупные интернет-ресурсы с большим количеством подписчиков используют дополнительные настройки для обеспечения безопасности доступа. К примеру, ваш аккаунт может быть заблокирован при многократных попытках неудачной авторизации. Слишком частые попытки законнектиться могут быть восприняты как действия бота. В этом случае вы увидите соответствующее сообщение, но можете быть просто переадресованы на страницу с кодом 401. Свяжитесь с администратором сайта и решите проблему.

Иногда простая перезагрузка проблемной страницы, выход из текущей сессии или использование другого веб-браузера полностью решают проблему с 401 ошибкой авторизации.

Ошибка 401 - отказ в доступе

Устранение ошибки 401 администратором веб-ресурса 

Для владельцев сайтов, столкнувшихся с появлением ошибки отказа доступа 401, решить ее порою намного сложнее, чем обычному посетителю ресурса. Есть несколько рекомендаций, которые помогут в этом:

  • Обращение в службу поддержки хостинга сайта. Как и в случае возникновения проблем с провайдером, лучше всего подробно описать последовательность действий, приведших к появлению ошибки 401, приложить скриншот.
  • При отсутствии проблем на стороне хостинг-провайдера можно внести следующие изменения в настройки сайта с помощью строки Disallow:/адрес проблемной страницы. Запретить индексацию страницам с ошибкой в «rоbоts.txt», после чего добавить в файл «.htассеss» строку такого типа:
Redirect 301 /oldpage.html http://site.com/newpage.html.

Где в поле /oldpage.html прописывается адрес проблемной страницы, а в http://site.com/newpage.html адрес страницы авторизации.

Таким образом вы перенаправите пользователей со всех страниц, которые выдают ошибку 401, на страницу начальной авторизации.

  • Если после выполнения предыдущих рекомендаций пользователи при попытках авторизации все равно видят ошибку 401, то найдите на сервере файл «php.ini» и увеличьте время жизни сессии, изменив значения следующих параметров: «session.gc_maxlifetime» и «session.cookie_lifetime» на 1440 и 0 соответственно.
  • Разработчики веб-ресурсов могут использовать более сложные методы авторизации и аутентификации доступа для создания дополнительной защиты по протоколу HTTP. Если устранить сбой простыми методами администрирования не удается, следует обратиться к специалистам, создававшим сайт, для внесения соответствующих изменений в код.

Хотя ошибка 401 и является проблемой на стороне клиента, ошибка пользователя на стороне сервера может привести к ложному требованию входа в систему. К примеру, сетевой администратор разрешит аутентификацию входа в систему всем пользователям, даже если это не требуется. В таком случае сообщение о несанкционированном доступе будет отображаться для всех, кто посещает сайт. Баг устраняется внесением соответствующих изменений в настройки.

Дополнительная информация об ошибке с кодом 401

Веб-серверы под управлением Microsoft IIS могут предоставить дополнительные данные об ошибке 401 Unauthorized в виде второго ряда цифр:

  • 401, 1 – войти не удалось;
  • 401, 2 – ошибка входа в систему из-за конфигурации сервера;
  • 401, 3 – несанкционированный доступ из-за ACL на ресурс;
  • 401, 501 – доступ запрещен: слишком много запросов с одного и того же клиентского IP; ограничение динамического IP-адреса – достигнут предел одновременных запросов и т.д.

Более подробную информацию об ошибке сервера 401 при использовании обычной проверки подлинности для подключения к веб-узлу, который размещен в службе MS IIS, смотрите здесь. 

Следующие сообщения также являются ошибками на стороне клиента и относятся к 401 ошибке:

  • 400 Bad Request; 
  • 403 Forbidden; 
  • 404 Not Found;
  • 408 Request Timeout.

Как видим, появление ошибки авторизации 401 Unauthorized не является критичным для рядового посетителя сайта и чаще всего устраняется самыми простыми способами. В более сложной ситуации оказываются администраторы и владельцы интернет-ресурсов, но и они в 100% случаев разберутся с данным багом путем изменения настроек или корректировки html-кода с привлечением разработчика сайта. 

Категория ~
Что делать (ошибки и проблемы)
– Автор:

Игорь (Администратор)

Сегодня рассмотрим такую специфическую ошибку как 401 Unauthorized Error. Почему специфическую? Потому что обычные пользователи интернета практически никогда не встречаются с данной ошибкой. Но обо всем по порядку.

Что значит ошибка 401 Unauthorized?

Ошибка 401 Unauthorized: что означает и как исправить?

Ошибка 401 Unauthorized («Отказ в доступе») — эта ошибка означает, что при попытке открыть веб-страницу сайта пользователем возникли проблемы с его авторизацией или аутентификацией.

Основная суть. Пользователь пытается открыть страницу. Сайт возвращает страницу с HTTP заголовком WWW-Authenticate (кстати, страница также с кодом 401 Unauthorized), в котором перечислены параметры системы аутентификации. Браузер запрашивает логин и пароль у пользователя, которые передаются в заголовке Authorization обратно к сайту (в соответствии с ранее полученными настройками системы безопасности). Если проверка прошла, то пользователю предоставляется дальше доступ к странице. В противном случае появляется ошибка 401 Unauthorized.

Кстати, стоит понимать, что данная ошибка отличается от 403 Forbidden, хотя и также связана с настройками безопасности.

Возможные причины возникновения ошибки 401 Unauthorized:

1. Некорректно введенные логин или пароль (или их отсутствие). Пользователь что-то некорректно ввел.

2. Недостаточно прав для доступа. Например, в каждом сайте вполне нормальным явлением считается то, что у обычного пользователя нет доступа к административной части сайта.

3. Ошибки в настройках или коде сайта. Такое тоже бывает.

Варианты возможных текстовых уведомлений:

1. HTTP Error 401 — Ошибка авторизации.

2. Требуется авторизация.

3. 401 Несанкционированный доступ.

4. 401 Unauthorized.

5. Authorization Required.

Что делать при ошибке 401 Unauthorized, если вы обычный посетитель сайта?

Рассмотрим что вы можете сделать, если вы обычный пользователь и столкнулись с ошибкой 401 Unauthorized:

1. Введите корректные логин и пароль. Ошибка 401 означает ошибку в авторизации или аутентификации, поэтому стоит проверить правильность введенных вами логина и пароля.

2. Проверьте корректность URL адреса страницы веб-сайта. Если вы не ожидали увидеть 401 Unauthorized (скажем, постоянно открывали сайт без проблем), то вполне нормальным действием будет проверить корректность адреса.

3. Попробуйте открыть страницу через время или с другого браузера. Вполне может быть так, что автор сайта что-то делает с этим самым веб-сайтом. Поэтому стоит подождать какое-то время и попробовать еще раз открыть веб-страницу. Так же может быть так, что ошибка 401 возникает из-за браузера (мало ли чего), поэтому стоит попробовать открыть страницу другим браузером (или с другого компьютера).

Кстати, обзор в тему Зачем пользователю несколько браузеров?

4. Напишите автору сайта. Как минимум узнаете причину или возможное время восстановления доступа.

Как исправить ошибку 401 Unauthorized, если вы владелец сайта?

Теперь рассмотрим как исправить ошибку 401 Unauthorized владельцу сайта:

1. Проверьте URL и логин с паролем. Владелец сайта это тоже пользователь сайта, поэтому проверить адрес страницы и корректность ввода логина с паролем будет не лишним действием.

2. Проверьте настройки и код сайта. Если же вам сайт делал кто-то иной, то попросите его проверить.

3. Напишите хостеру. Если вы все проверили и проблем не обнаружили, то нужно писать хостеру.

Понравилась заметка? Тогда время подписываться в социальных сетях и делать репосты!

☕ Понравился обзор? Поделитесь с друзьями!

  • Ошибка 500 Internal Server Error: что означает и как исправить?

    Ошибка 500 Internal Server Error: что означает и как исправить?
    Что делать (ошибки и проблемы)

  • Ошибка 404 Page Not Found: что означает и как исправить?

    Ошибка 404 Page Not Found: что означает и как исправить?
    Что делать (ошибки и проблемы)

  • Ошибка 403 Forbidden: что означает и как исправить?

    Ошибка 403 Forbidden: что означает и как исправить?
    Что делать (ошибки и проблемы)

  • Ошибка 502 Bad Gateway: что означает и как исправить?

    Ошибка 502 Bad Gateway: что означает и как исправить?
    Что делать (ошибки и проблемы)

  • Ошибка 503 Service Unavailable: что означает и как исправить?

    Ошибка 503 Service Unavailable: что означает и как исправить?
    Что делать (ошибки и проблемы)

  • Коды и ошибки 301, 302, 303, 304

    Коды и ошибки 301, 302, 303, 304
    Что делать (ошибки и проблемы)

Добавить комментарий / отзыв

Страница с ошибкой при обращении к WordPress-сайту всегда вызывает неудобства, вне зависимости от того, ваш это сайт или чужой. Как и в случае со многими другими кодами ответов HTTP, ошибка 401 не содержит детальных данных для диагностики и решения проблемы.

Ошибка 401 может появиться в любом браузере. В большинстве случаев ее легко решить.

В этой статье мы расскажем, что означает 401 ошибка, почему она происходит, и какие методы ее устранения существуют.

Итак, приступим!

Содержание

  1. Код ошибки 401 – что это?
  2. Что вызывает ошибку 401
  3. Как исправить ошибку 401 (5 методов)

Код ошибки 401 – что это?

Коды состояния HTTP 400 возникают в случае проблем с выполнением запросов. В частности, ошибка 401 появляется, когда браузер отказывает вам в доступе к странице, которую вы хотите посетить.

В результате вместо загрузки страниц браузер выведет сообщение об ошибке. Ошибки 401 могут возникать в любом браузере, потому отображаемое сообщение может варьироваться.

К примеру, в Chrome и Edge вы, скорее всего, увидите иконку бумаги с простым сообщением о том, что запрашиваемая страница не отвечает. Вы увидите фразу «HTTP Error 401». Вам будет предложено связаться с владельцем сайта, если ошибка не пропадет:

В иных случаях и в других браузерах вы можете получить менее дружелюбное предупреждение. К примеру, может выводиться пустая страница с сообщением «401 Authorization Required»:

Другие вариации текста:

  • HTTP 401 Error – Unauthorized
  • 401 Unauthorized
  • Access Denied

Эти ошибки часто появляются на сайтах, где требуется вводить данные для входа. В большинстве случаев это означает, что что-то не так с учетными данными. Возможно, браузер перестал считать их действительными.

Эта ошибка похожа на HTTP 403 Forbidden Error, когда доступ к сайту для пользователя запрещен. Однако, в отличие от ошибки 403, сообщение об ошибке 401 указывает, что процесс аутентификации завершился неудачно.

Код ошибки передается через заголовок WWW-Authenticate, который отвечает за определение метода аутентификации, используемого для предоставления доступа к веб-странице или ресурсу.

Что вызывает ошибку 401

Если вы столкнулись с кодом ошибки в кодах 400, вы должны знать, что проблема произошла на стороне клиента (либо на стороне браузера). Случается, что виновником проблемы является браузер, но так бывает не всегда. Об этом мы еще расскажем позже.

Ошибки 401 возникают на ресурсах с ограниченным доступом – к примеру, на страницах, защищенных паролем. Потому можно предположить, что причина проблемы связана с данными аутентификации.

Устаревшие Cookie и кэш браузера

Одной из наиболее распространенных причин возникновения ошибки 401 является то, что кэш и файлы cookie вашего браузера устарели, что не позволяет выполнить авторизацию. Если ваш браузер использует недействительные данные для авторизации (либо вообще их не использует их), сервер отклонит запрос.

Несовместимые плагины

Также бывают ситуации, когда ошибка вызвана несовместимостью плагинов или какими-либо сбоями в них. К примеру, плагин безопасности может ошибочно принять вашу попытку входа за вредоносную активность, а потому будет возвращена ошибка 401 для защиты страницы.

Неверный URL или устаревшая ссылка

Бывает, что источником проблемы является незначительная оплошность. К примеру, был неверно введен URL, ссылка была устаревшей и т.д.

Как исправить ошибку 401 (5 методов)

Теперь, когда мы разобрались с причинами ошибки 401, пришло время обсудить, как ее устранить.

Давайте рассмотрим 5 методов, которые вы можете использовать.

  1. Проверьте ваш URL.

Начнем с самого простого потенциального решения: убедитесь, что вы использовали верный URL. Это может выглядеть банально, но 401 ошибки нередко появляются, если URL-адрес был введен неправильно.

Еще один вариант: ссылка, которую вы использовали для перехода на запрашиваемую страницу, указывает на неправильный URL. К примеру, ссылка устарела, ведет на страницу, которой больше нет (и редиректов не задано).

Стоит тщательно перепроверить URL-адрес, который вы использовали. Если вы набирали адрес самостоятельно, убедитесь, что все написано безошибочно. Если вы переходили по ссылке, убедитесь в том, что она ведет на страницу, к которой вы хотите получить доступ (либо попробуйте перейти на эту страницу непосредственно через сайт).

  1. Почистите кэш браузера.

Кэш браузера предназначен для улучшения процесса взаимодействия с сайтами в сети за счет сокращения времени загрузки страниц. К сожалению, иногда это может вести к нежелательным последствиям.

Как мы уже говорили выше, одной из распространенных причин появления ошибки 401 являются устаревшие или неправильные данные кэша или cookies. Потому, если URL введен верно, следующий шаг – чистка кэша браузера.

В итоге вы удалите любую недействительную информацию, которая хранится локально в вашем браузере и может приводить к прерываниям процесса аутентификации.  Аналогично, файлы cookie вашего браузера могут содержать аутентификационные данные, которые нужно обновить.

Если вы пользуетесь Chrome, вам нужно щелкнуть по иконке с меню в правом верхнем углу браузера и выбрать пункт Settings. В разделе «Privacy and security» нажмите «Clear browsing data:»

Далее вводим URL требуемого сайта и очищаем для него данные.

В других браузерах процесс очистки кэша и cookie может отличаться. К примеру, в Firefox нужно щелкать по иконке с библиотекой и выбирать History > Clear Recent History:

Информацию по остальным браузерам вы можете найти в поисковиках.

  1. Очистка DNS.

Еще один метод, который вы можете попробовать для устранения ошибки 401 – это очистка DNS. Эта причина встречается относительно редко, но стоит попробовать и такой подход, особенно если первые два ничего не дали.

Чтобы очистить DNS, перейдите в Windows к меню «Пуск» и там уже введите в строку поиска cmd. Нажмите Enter. Откроется командная строка. Далее вставьте команду ipconfig/flushdns, после чего снова нажмите Enter.

Если вы пользуетесь Mac, вы можете открыть командную строку следующим образом: Finder > Applications > Utilities > Terminal.

Введите команду sudo killall -HUP mDNSResponder и нажмите Enter. Затем вы можете обновить страницу, чтобы посмотреть, пропала ли ошибка 401 или нет.

  1. Деактивируйте ваши плагины

Проблема может возникать и по вине плагинов.

Некоторые плагины, особенно связанные с безопасностью, могут выдавать ошибку 401 при подозрении на вредоносную активность. Также у них могут быть проблемы с совместимостью. Потому лучше всего деактивировать все плагины и посмотреть, будет ли страница работать.

Вы можете деактивировать все плагины разом, перейдя в раздел Plugins > Installed Plugins в консоли WordPress. Выберите все плагины и в меню Bulk Actions задайте Deactivate, после чего щелкните по кнопке Apply:

После этого попробуйте перезагрузить страницу с ошибкой. Если ошибка пропала, вы можете вручную по одному активировать плагины заново, чтобы выявить виновника всех бед.

Далее вы уже можете либо удалить плагин, либо написать его разработчикам, чтобы они предоставили рабочее решение.

  1. Проверьте заголовок WWW-Authenticate

Если проблема все еще остается, то в таком случае она может быть связана с ошибками на сервере. А значит, исправить ее будет чуть сложнее.

Как мы уже писали ранее, ответ 401 передается через заголовок WWW-Authenticate, который отображается как “WWW-Authenticate: <type> realm=<realm>”. Он включает в себя строки данных, указывающие на то, какой тип аутентификации требуется для предоставления доступа.

Вам нужно посмотреть, был ли отправлен ответ в WWW-Authenticate, а точнее какая схема аутентификации была использована. По крайней мере, это позволит вам приблизиться на один шаг к решению.

Перейдите на страницу с ошибкой 401 и откройте консоль разработчика в Chrome. Вы можете щелкнуть правой кнопкой мыши на странице и выбрать Inspect (Ctrl+Shift+J).

Далее перейдите на вкладку Network и перезагрузите страницу. Это позволит сгенерировать список ресурсов. Выберите заголовок Status, чтобы отсортировать таблицу, и найдите код 401:

Выберите данную запись, после чего перейдите на вкладку Headers. В Response Headers найдите заголовок WWW-Authenticate:

Информация, представленная в заголовке ответа, в частности, в схеме аутентификации, даст вам больше сведений о том, что произошло, и укажет на решение. Это позволит вам понять, какой тип аутентификации требуется серверу.

К примеру, в приведенном выше примере мы видим, что схема аутентификации задана как «Basic». Это означает, что запрос аутентификации требует только ID и password. Для получения более подробной информации и инструкций мы рекомендуем обратиться к HTTP Authentication Scheme Registry.

Источник: kinsta.com

Methods to fix a 401 Unauthorized error

Updated on September 15, 2022

The 401 Unauthorized error is an HTTP status code that means the page you were trying to access cannot be loaded until you first log in with a valid user ID and password.

If you’ve just logged in and received the 401 Unauthorized error, it means that the credentials you entered were invalid for some reason.

401 Unauthorized error messages are often customized by each website, especially very large ones, so keep in mind that this error may present itself in more ways than these common ones:

  • 401 Unauthorized
  • Authorization Required
  • HTTP Error 401 — Unauthorized
Lifewire / Kaley McKean

The 401 Unauthorized error displays inside the web browser window, just as web pages do. Like most errors like these, you can find them in all browsers that run on any operating system.

How to Fix the 401 Unauthorized Error

  1. Check for errors in the URL. It’s possible that the 401 Unauthorized error appeared because the URL was typed incorrectly or the link that was selected points to the wrong URL—one that is for authorized users only.

  2. If you’re sure the URL is valid, visit the website’s main page and look for a link that says Login or Secure Access. Enter your credentials here and then try the page again.

    If you don’t have credentials or have forgotten yours, follow the instructions provided on the website for setting up an account or resetting your password.

    Do you usually struggle to remember your passwords? Consider keeping them in a password manager so that you only have to remember one password.

  3. Reload the page. As simple as it might seem, closing down the page and reopening it might be enough to fix the 401 error, but only if it’s caused by a misloaded page.

  4. Delete your browser’s cache. There might be invalid login information stored locally in your browser that’s disrupting the login process and throwing the 401 error. Clearing the cache will remove any problems in those files and give the page an opportunity to download fresh files directly from the server.

  5. If you’re sure the page you’re trying to reach shouldn’t need authorization, the 401 Unauthorized error message may be a mistake. At that point, it’s probably best to contact the website owner or other website contact and inform them of the problem.

    The web site owner of some websites can be reached via email at webmaster@website.com, replacing website.com with the actual website name. Otherwise, find a Contact page for specific contact instructions.

Other Ways You Might See 401 Errors

Web servers running Microsoft IIS might give more information about the 401 Unauthorized error, such as the following:

Microsoft IIS 401 Error Codes
Error Explanation
401.1 Logon failed.
401.2 Logon failed due to server configuration.
401.3 Unauthorized due to ACL on resource.
401.4 Authorization failed by filter.
401.5 Authorization failed by ISAPI/CGI application.
401.501 Access Denied: Too many requests from the same client IP; Dynamic IP Restriction Concurrent request rate limit reached.
401.502 Forbidden: Too many requests from the same client IP; Dynamic IP Restriction Maximum request rate limit reached.
401.503 Access Denied: the IP address is included in the Deny list of IP Restriction
401.504 Access Denied: the host name is included in the Deny list of IP Restriction

You can learn more about IIS-specific codes on Microsoft’s the HTTP status code in IIS 7 and later versions page.

Errors Like 401 Unauthorized

The following messages are also client-side errors and so are related to the 401 Unauthorized error: 400 Bad Request, 403 Forbidden, 404 Not Found, and 408 Request Timeout.

A number of server-side HTTP status codes also exist, like the often-seen 500 Internal Server Error.

FAQ

  • What do I do if I receive a http 401 error in Zoom?

    Double-check the URL to make sure it’s accurate, and if so reload the page. If that doesn’t work, log out and log back in again, and if you’re still having problems try turning off any themes or plugins that may be active. Clearing your browser cache might also fix the issue.

  • What’s the difference between 401 Unauthorized and 403 Forbidden?

    A 401 Unauthorized code indicates some sort of issue tied to login credentials for a given web page, while 403 Forbidden errors mean the page has been blocked.

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Subscribe

In my previous post, you learned how to troubleshoot HTTP Error 503. Today, we will look into how to troubleshoot 401 – Unauthorized: Access is denied due to invalid credentials in Internet Information Services (IIS).

Contents

  1. 401 – Unauthorized
  2. How IIS authentication works
  3. Cause of error
  4. Debugging the error
  5. Resolving the error
  6. Common 401 substatus codes
  7. Conclusion
  • Author
  • Recent Posts

Surender Kumar has more than twelve years of experience in server and network administration. His fields of interest are Windows Servers, Active Directory, PowerShell, web servers, networking, Linux, virtualization, and penetration testing. He loves writing for his blog.

Latest posts by Surender Kumar (see all)

  • Extending LVM space in Ubuntu — Thu, Feb 2 2023
  • Backup in Proxmox VE — Thu, Jan 26 2023
  • Snapshots in Proxmox VE — Wed, Jan 25 2023

401 – Unauthorized

401 Unauthorized Access is denied due to invalid credentials

401 Unauthorized Access is denied due to invalid credentials

The 401 – Unauthorized: Access is denied due to invalid credentials error is a common access-related error that you may experience with a website hosted on IIS.

How IIS authentication works

The error itself indicates that it is caused by a failure to authorize access. Someone who is a beginner in IIS could find the error description «you do not have permission to view this directory or page using the credentials that you supplied» slightly confusing. If you think from an end user’s perspective, you might be wondering when you supplied any credentials while accessing the website. Well, this happened automatically on the server side. By default, every website hosted on IIS has anonymous authentication enabled.

If you open the IIS Manager, select your website, and then double-click Authentication under the IIS section in the Features view, you will see the various authentication modes (such as basic authentication, forms authentication, anonymous authentication, etc.) that are supported by IIS.

Viewing various authentication modes supported by a website in IIS

Viewing various authentication modes supported by a website in IIS

Each website has to have at least one authentication mode enabled and, by default, Anonymous Authentication mode enabled. Authentication is a mechanism that is used to verify the visitor’s identity to your website. See the following screenshot for reference:

Default authentication modes supported by a website in IIS

Default authentication modes supported by a website in IIS

Anonymous authentication allows visitors to access the public content of your website anonymously without having to supply any credentials. If you don’t want to use it, select the authentication mode, and then click Disable in the Actions pane on the right. To view or modify which credentials are used by anonymous authentication, click the Edit link on the right. You will see two options, as shown in the following screenshot:

View or modify the credentials used by anonymous authentication in IIS

View or modify the credentials used by anonymous authentication in IIS

By default, each website is set to use the IUSR user for anonymous user identity, which is a built-in account starting with IIS version 7. If you are using a custom username as the application pool identity, make sure you select the application pool identity option here. This way, you don’t have to worry about updating the user’s password in the website configuration over and over when the user’s password is changed.

Cause of error

The primary cause of the 401 – Unauthorized: Access is denied due to invalid credentials error is that you are using a custom username as the application pool identity. In simple terms, when you set the application pool to use a custom application pool identity (a custom username and password) rather than the default identity (which is ApplicationPoolIdentity), the Anonymous Authentication mode of the website continues using the IUSR user for authentication, which results in this error.

Debugging the error

As discussed in previous posts, the error page we saw above is a custom error page and does not reveal much helpful information for administrators. If you enable the detailed errors, you will see an error page with much detailed information, as shown in the following screenshot:

Error message 401.3 – You do not have permission to view this directory or page using the credentials you supplied (acc

Error message 401.3 – You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists)

The detailed error gave you the HTTP 401.3 status code, which will guide you in checking the access control permissions on the file system. Make sure that the user who is set as the application pool identity has the read and execute permissions on the website’s root directory. If the error persists, the most likely cause is incorrect anonymous user identity. The following screenshot shows the problematic scenario:

Mismatched application pool identity and anonymous authentication identity user in IIS

Mismatched application pool identity and anonymous authentication identity user in IIS

The screenshot shows a mismatched application pool identity and anonymous authentication identity on the website, which is causing the error. For a website to work properly, both should be the same.

Resolving the error

Now that you know the cause of the HTTP 401.3 status code, do the following to fix the error:

If you are using a custom username as the application pool identity, make sure that the user has read and execute permissions on the website’s root directory.

Ensuring that the custom application pool user has read and execute permissions on the root directory

Ensuring that the custom application pool user has read and execute permissions on the root directory

If you’re using the default ApplicationPoolIdentity for your application pool, make sure that the built-in IUSR user or IIS_IUSRS group has exactly the same permissions as shown in the screenshot below.

Ensuring that the default application pool identity has read and execute permissions on the root directory

Ensuring that the default application pool identity has read and execute permissions on the root directory

If the error persists, edit the Anonymous Authentication setting of your website, as explained in the How IIS authentication works section. Be sure it is set to use the Application pool identity. See the following screenshot for reference:

Modifying the anonymous authentication identity to match the application pool identity in IIS

Modifying the anonymous authentication identity to match the application pool identity in IIS

Common 401 substatus codes

The following table covers the most common HTTP 401 substatus codes, along with their possible causes and troubleshooting advice:

Subscribe to 4sysops newsletter!

Status Code Possible Cause Troubleshooting Advice
401.1 Logon failed The logon attempt failed, probably due to an invalid user name or password.
401.2 Logon failed due to server configuration The 401.2 status code indicates that there is a problem in the authentication configuration on the server.
401.3 Unauthorized due to ACL on resource We covered how to fix this error above.

Conclusion

I hope you’re enjoying this series of resolving common HTTP errors. In the next post, we will discuss how to fix the HTTP Error 403.14 – Forbidden error.

You’d think that with more people online, we’ll come to better understand the internet’s inner workings. However,  the internet has become intuitive to the point where everyone can access it without being technology savvy. After all, you don’t need a digital literacy training to watch cat videos and like Facebook posts. But messages like 401 Unauthorized Access have the habit of reminding us that there’s more to the internet than meets the eye.

If you’re a frequent browser, chances are you’ll encounter this message at some point. This particular HTTP status code is signaling that the page you’re trying to access will not load until you sign in with a valid user ID and/or password.

But this error message comes in different shapes and sizes. Here’s a list of the most popular variations of the 401 Unauthorized Access error:

  • Authorization Required
  • 401 Unauthorized
  • HTTP Error 401 – Unauthorized
  • Response: HTTTP_Unauthorized

Note: Some website owners might create a custom page for this particular error. Depending on the site you’re accessing, you might see this error message along with other graphic elements, as opposed to plain text on a white background.

This error is a common occurrence when you try accessing a site that requires you to provide additional login information. Although this is primarily a client-side error, it can be triggered as a result of a server error when confirming the authentication credentials.

Before we get to the fixing part, it’s important to understand the main reasons why this error shows up in the first place:

  • Incorrect URL
  • Incorrect Login Credentials
  • Trying to access a page without being logged in
  • Site requires login information without prompting you to log in (server-side issue)
  • DNS lookup error

Method 1: Double-checking the URL for errors

This one might seem offensive to tech-savvy persons, but it needs to be said. Before doing anything else, be absolutely sure that the URL you’re entering is correct. If you’re accessing a link that you’ve previously bookmarked, make sure that the link you’re accessing hasn’t been moved. To do this, visit the index page (home page) of the website and navigate to the web page that you want to access using the in-site hyperlinks.

For e.g. – If you used to visit a page from a bookmark with a custom URL (www.appuals.com/category/guides/), lose the subdirectories and visit the homepage (www.appuals.com). You can then use the site menus to navigate to your desired location.

Method 2: Make sure you are logged in

As explained above, this error is a sign that your user credentials aren’t OK’d by the server your accessing. If the server you’re accessing has a log-in system, insert your log-in information first or create a new account before accessing the custom URL page from that particular website.

Most sites have a log-in button in the top-left or top-right corner of the screen. Look for it before and provide your log-in information before browsing any further. Once you are logged in, you should be granted access to the web page you desire.

Method 3: Make sure you insert the correct login credentials

If you’re only visiting big sites, then you are used to the following scenario: You enter your log-in information but you mistype your password or email. After you hit Enter, you’re presented with a message saying “The username/password is incorrect“. This is pretty self-explanatory, but keep in mind that not every website will have a complex log-in system.

Some websites will not hold your hand when trying to log in. So if you type the wrong credentials while visiting a small website, there’s a chance that the server will present you with a 401 Unauthorized error instead of pointing you in the right direction.

In order to make sure that you’re not mistyping your password/user, it’s good practice to reset your password and try again. Most sites will usually send an email with your username and your new password.

Method 4: Eliminating a potential DNS Error

It’s fairly rare that a DNS error will end up promoting yo with a 401 Unauthorized error in your browser, but it can definitely happen. But just to be sure, you should flush your DNS and see if that’s the case. It virtually takes a couple of seconds.

To flush your DNS, follow the steps below:

  1. Press Windows key + R to open a Run window. Type cmd and hit Enter.
  2. Type ipconfig /flushdns and press Enter.
    Note: If you’re on Mac, open a Command Terminal, type sudo killall -HUP mDNSResponder and hit Enter. It’s equivalent to the command on Windows.

Conclusion

Hopefully, one of the methods above has enabled you to go past the 401 Unauthorized error. If you followed a different path that was successful in eliminating the error message, tell us all about it in the comment section below.

If the steps above didn’t work, there’s a good chance that the problem is indeed server-side. Your only option right now is to wait for the site administrator to remedy the issue. If you can’t wait, contact them immediately and ask them to check if they have a case of false login requirement.

Photo of Kevin Arrows

Kevin Arrows

Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

How to Solve 401 Unauthorized Access Error?

When you want to login to any page are you facing a 401 Unauthorized Access error?

401 Unauthorized Access Error is a known HTML Error Code, which encounters when you are surfing on the internet. It usually displayed on the site that requires user credentials. The meaning of this error is very cleared that you don’t have access rights to the requested page.

This page will not load until you sign in with a valid User ID and Password. This message reminds us to fill the right details if, you want to login to your site.

What does 401 Unauthorized Access Error Means?

All HTTP response status codes that are in the category of 4xx, all considered as Client-Side error response. It means that you, your browser, or your connected hardware are unable to access some required steps, that are necessary to access particular web content.

It might be a problem with your wrong username and password, might be something wrong in your hardware configuration that needs to be changed, or might be connectivity error.

The 401 Unauthorized Access Error is an HTTP Status code that means you don’t have permission to access the requested website and if you want, then you have to login first. If you are trying to log in, and you are receiving the 401 Unauthorized Access error, then it probably means that entered credentials are invalid for some reason.

Mostly this error occurs when you access that site where you need to provide additional login information. Although this is a client-side error, it can be triggered as a server error when confirming the authentication credentials.

Variations of 401 Error

The error is not standard, so keep this in mind, the error represents itself in different ways. Some of the error variations are:

  • “401 Unauthorized”
  • “Authorization Required”
  • “HTTP Error 401 – Unauthorized”
  • “Response: HTTTP_Unauthorized”

Note: Representation of the error also depends on the site, because some website owners create there own custom page.

What are the Reasons?

1. Incorrect URL

When you are trying to access an invalid URL, then you get 401 error message.

2. Incorrect Login Credentials

If you enter the wrong username and the password, Hence you get the 401 error.

3. Trying to Access a Page without Log In

When you want to request a part of the site which requires you to be securely logged in, then you’ll get 401 error message.

4. DNS Error

In some rare circumstances, it might be possible that the DNS lookup errors are responsible for 401 error message on your browser. The site requires login information without prompting you to log in (server-side issue).

How to Fix 401 Unauthorized Error?

Method 1) Incorrect URL

Before doing anything else, check the entered URL is correct or not, most of the time this is the main culprit of the 401 error. Sometimes you give the wrong URL or try to open the URL link which is reserved for only authorized users before you type, to make sure that you provide a valid address.

Many web servers provide security from inappropriate URLs for example, obtaining a file directory through URL to access the data. In this case, type the correct URL and reload the page to solve the problem. Sometimes if we are going to a particular URL through some link, then it’s possible the link is wrong.

Method 2) Make Sure You Logged In

If your URL is valid, but you can not access the site, then it might be possible you aren’t login to the site.

In the landing page of the site, look for a login link, then give your credentials and load the page. If you don’t have credentials, then create a new account with the help of secure access link before accessing the site. Once you are log in to the site, you’re able to access any part of the site without any trouble.

Method 3) Insert the Correct Login Credentials

If you are getting a 401 error after login, then it means your provided username either password is invalid. You have to provide correct username and password. In case, when you forget your password, then reset it by using the sites in-built Password Reset feature to choose a new password.

This process is simple if you registered the website with your valid email address, then most of the sites send an email with your username and with a new password. Otherwise, you have to contact the website admin to regain the access. Try again after filling the correct login information of your site.

Method 4) Clear your Web Browser Cache and Cookies

When 401 error occurs, it means the client has not authorized to perform the particular request, the reason behind this may be the invalid or corrupted cookies which cause improper authentication for the server.

Your browser cache stores the local copies of web content and resources, it might be possible that your live version is conflicting with the cached version of your desktop which causes 401 error. You have to clear your cache and cookies to get rid of this error with the help of the combination of keys ctrl+shift+del.

Method 5) Temporarily Disable all Plugins and Theme

To solve the 401 error,  you have to disable all your Plugins and Theme. Maybe one of your Plugin or Theme creates 401 error.

You have to disable all Plugins and Theme by Rename the name of the folder from the File Manager in the cPanel.

How to Solve 401 Error Rename Plugin Theme

If your Plugin or Theme is the reason for the 401 error, then disable all Plugins or theme can resolve the issue.

Method 6) Eliminating a Potential DNS Error

When DNS error is the reason behind 401 error, then you have to flush your DNS to remove it, and advised you to maintain your internet services on a regular basis.

To flush DNS in windows follow the below steps:

1. Press window key+R to Open the Run window.
2. Type cmd command in the window and click on Ok button.

How to Solve 401 Unauthorized Error Run Command Prompt

3. A command terminal window will be open on the screen. Type the ipconfig /flushdns command on the screen and press Enter.

How to Solve 401 Unauthorized Error Command Prompt Flush DNS

4. After a few minutes, it ends up with the Successfully Flushed message.

Hopefully, the steps given in this article will help you to understand more about the HTML 401 Error and also how to fix it.

WordPress Plugins


  • Backup Bank


  • Captcha Bank


  • Captcha Booster


  • Clean Up Booster


  • Clean Up Optimizer


  • Coming Soon Booster


  • Contact Bank


  • Facebook Like Box


  • Gallery Bank


  • Gallery Master


  • Google Maps Bank


  • Limit Attempts Booster


  • WP Mail Bank


  • WP Mail Booster

How to Solve 401 Unauthorized Access Error? 1

For as much time as we tend to spend online, you’d think we would be taught a firmer understanding of the internet’s inner workings. Alas, we are not, and thus error messages like “401 Unauthorized Access” are still something that most do not know how to solve. We’ve become fairly adept at taking apart and explaining many of the various error messages that inhabit your online lifestyle, and this is another that we’re going to lay out in front of you. If this is something that you’ve run into fairly frequently while browsing, you’re going to get some knowledge about why you’re running into it, and how to resolve it.

Let’s face it — we’re all probably subscribed to too many newsletters, way too many websites, and more “special offers” than we could ever remember. And that’s not even beginning to delve into all of the sites and services that we’ve signed into simply by linking them to our social media accounts. Sometimes, Facebook can seem like a master key to the internet, right? But even though we can’t keep track of those, our computers do. And those sites that require a specific username and password in order to get you access don’t really have a workaround. That’s a good thing, after all; we want our internet to remain as safe and secure as possible.

This particular error message can manifest in a number of ways, but it’s usually just a “401 Unauthorized” tag splashed across a blank background in your web browser. It almost always shows up after you’ve tried accessing a site or service that usually requires an username and password. When you get it wrong (or don’t have it in the first place) this error message shows up.

However, there are occasions when you do have the right login information, but for some reason, you’re unable to access the site as per usual. It’s primarily these situations that we’re hoping to address, today. Because the internet is a complex thing, and security can be tantamount to jumping through five flaming hoops at a circus, it’s understandable that people sometimes run into this error message, be it by their own fault with the wrong login info, or something that needs to be resolved by the website’s administrator.

HTTP Status Codes

Though error codes might seem like snippets snatched from the pages of technical wizardry, they’re anything but. For those who would like to take the time to learn how to understand them, it’s not a difficult process. And even the most basic understanding can help you to navigate through problems that might have otherwise left you confused and worried.

We can start to break this down by looking at the two primary parties responsible for getting you to the websites that you want to visit (and no, I’m not about to get political on you.) Though there’s more to it than this, it’s helpful to see things as either client-side or server-side. The “client” is essentially you, your web browser, your computer, and the hardware that you’re using to connect to the internet, such as a modem and router. The “server” is responsible for hosting the content that you’re trying to reach, as well as maintaining the certificates and security standards in place to determine whether or not you have access to it.

“Using the HTTP protocol, computer scientists around the world began making the Internet easier to navigate by inventing point-and-click browsers. One browser in particular, called Mosaic, created in 1993 at the University of Illinois, would help popularize the Web, and therefore the Net, as no software too had yet done.”- Katie Hafner

Knowing this, we can better understand two very common types of online error codes. 4xx error messages (anything in the 400s) are specifically client errors. This means that you, your browser, your computer, or your connected hardware have failed to perform some necessary step required to access particular web content. It might be the wrong username and password, or it might be something in your hardware configuration that needs to be changed. It could even be a connectivity error.

5xx error messages (anything in the 500s) are server errors. This means that the fault is very likely not with you, but with the host server for the website or service not responding properly. In these instances, there’s very little that you can do, apart from contacting the site’s administrators.

All of this doesn’t necessary help to make the “401 Unauthorized” error any easier to swallow, however. It’s still a pain in the butt, and there are still several different reasons that it can show up, in the first place.

  • Invalid URL: It’s quite possible that you’ve entered the wrong URL for the website or service that you’re trying to access. Make sure that it’s accurate!
  • Not Logged In: If you’re trying to access a part of a site that requires you to be securely logged in with registered login information, you’ll get a 401 error.
  • Invalid Login Credentials: If your login credentials are incorrect, you’re probably going to get a 401 error.
  • False Login Requirement: This one’s tricky; if a site shouldn’t require login information, but for some reason appears to, it might be the fault of the site’s administrator. While this is an error that clearly takes place on the server side of things, it’s registering as a client-side error. Hence, you’ll see the 401 Unauthorized message.
  • DNS Errors: In some rare circumstances, it’s possible that DNS lookup errors can prompt a 401 message.

There are a few other outliers, but these are far and away the most likely culprits for your 401 Unauthorized error message. Below, we’re going to move through each of them, and help you to work around this particularly troublesome obstacle.

Resolving the Error Message

Thankfully, the steps necessary to resolve any of these situations is fairly easy. Using the above information, determine which is the most likely scenario for you, and then take a look at our possible solutions.

Invalid URL

This one might seem like a bit of a no-brainer, but if you’re manually entering URLs, it’s quite possible that you might have simply entered it incorrectly. Either that or the link that you’ve bookmarked — usually part of a site that’s behind login requirements — no longer exists. If the URL is entered correctly, then make sure that you’re trying to access part of the site or service that’s available before you’ve logged in.

Not Logged In

Tangentially related to the above problem, it’s possible that you’re seeing the 401 Unauthorized message because you’re not logged into the site or service. Just as above, you’re going to want to navigate to the part of the site, either by way of links or an URL, that allows you to securely log in. Most website landing pages give you a place to do this.

Make sure that you have the correct username and password for the site, enter them, and then try again. Once you’re logged into the site itself, you should be able to navigate to any part of it that you have access to, without any trouble.

Invalid Login Credentials

Most 401 Unauthorized errors come as a result of this particular problem, and there are quite a few reasons for that. First, it’s very easy to misremember login information in the first place. We’re encouraged to use passwords that are entirely random — not recognizable phrases or words. Thus, without a strong password management application (I’ll recommend a couple, below) it’s possible that you’re not going to remember all of your passwords. If you’re unable to log in without getting a 401 Unauthorized error, use the site’s built-in “Password Reset” feature to choose a new password. As long as you’re registered with the site by way of an email address, this should be easy. If a more complicated process is required, contact the site’s administrator.

Try it again, after ensuring that your login information is correct, and you should be able to move right past the error message. Meanwhile, consider using a password data management app like LastPassLogMeOnce, or Keeper.

False Login Requirement

As mentioned above, here’s a tricky problem to have, when you run into that 401 Unauthorized error message. Even though 4xx errors are client-side, that doesn’t necessarily mean that the origin of the large problem isn’t coming from the website’s host server.

Here’s how it might work out — a network administrator for a particular site accidentally enables login authentication where none should be required. Suddenly, websites that were normally accessible to people who weren’t logged in, are spitting out 401 Unauthorized messages to anyone that attempts it. Technically, it is a client-side error, since the site is programmed to require login information. But since that requirement is a result of user error on the server side, the only way to effectively resolve it is to wait for it to be remedied by the site administrators.

And as before, when it comes down to those running the host server, the best thing to do is contact them directly.

DNS Errors

It’s rare that DNS errors actually prompt a 401 Unauthorized error in your browser, but it’s not entirely unheard of. Either way, flushing the DNS is easy to do, and often advised if you want to regularly maintain your internet service.

In Windows open the Command Prompt with Administrator access. Simply type in cmd.exe in the Windows Search bar, and ensure that you select the option of running it as the computer’s administrator. Once the Command Prompt has opened, type in ipconfig /flushdns and press Enter. See? Easy as pie.

In Mac OS X, the process is slightly different. Open up the Command Terminal, and then type in sudo killall -HUP mDNSResponder. This will flush the DNS, and in rare circumstances, allow you to proceed past a 401 Unauthorized error that has no other apparent cause.

Hopefully, our steps above have helped you to fix the errors that are keeping you from your web content. the 401 Unauthorized error can easily leave users stumped, without any clear path on how to solve it. If you have any questions or need further help with our recommended solutions, let us know in the comments below!

Ryan is a computer enthusiast who has a knack for fixing difficult and technical software problems. Whether you’re having issues with Windows, Safari, Chrome or even an HP printer, Ryan helps out by figuring out easy solutions to common error codes.

Ошибка сервера 401 Unauthorized возвращается в ответ на запрос пользователя в том случае, если он
пытается получить доступ с авторизацией, которая не может быть подтверждена сервером.

О чем свидетельствует «ошибка 401»

Она говорит о том, что пользователь передал неверный запрос, в котором некорректны данные в заголовке
www.authenticate. Сервер не может распознать такой запрос. Чаще всего это происходит потому, что
пользователь ввел неправильный пароль и логин, или, например, сменил пароль, но пытается ввести старый.
Также иногда это может свидетельствовать о некорректной работе сервера, на котором происходит
авторизация.

Что делать пользователю, когда в браузере появляется код ошибки 401

Самый очевидный путь для преодоления ошибки Unauthorized — это заполнить предложенные поля для логина и
пароля заново. Если вы не можете вспомнить пароль, воспользуйтесь опцией его восстановления. Если же вы
уверены, что все введенные данные корректны, но сервер все равно возвращает в ответ на запрос ошибку
401, обратитесь к администратору ресурса. Возможна ситуация, при которой ваша учетная запись по тем или
иным причинам была заблокирована или деактивирована, но выдача соответствующего сообщения на сайте не
настроена. В этом случае по умолчанию сервер также возвратит вам ошибку 401.

Также может быть, что ваши права по авторизации на определенном ресурсе ограничил ваш провайдер услуг
интернет. Для проверки этого предположения попробуйте воспользоваться любым сервисом VPN. Если ошибка в
таком случае не возникает, обратитесь к провайдеру за разъяснением.

Владельцы сайтов, чьи пользователи массово получают ошибку 401 Unauthorized, должны обращаться в службу
технической поддержки хостинг-провайдера. В таком случае желательно отправить скриншот с ошибкой.

Причины возникновения ошибки «ERROR 401 UNAUTHORIZED»

Наиболее распространенными причинами возникновения ошибки 401 являются все-таки неправильные запросы от
браузера пользователя. Такие запросы не содержат информации, необходимой для авторизации пользователя,
либо такая информация некорректна. Чаще всего это ошибка в вводе пароля и/или логина, объясняющаяся
действием человеческого фактора. Реже проблема может возникать на стороне обрабатывающего запрос
сервера.

Вас также может заинтересовать

Понравилась статья? Поделить с друзьями:
  • Unarch dll вернул код ошибки 11
  • Unarc dll скачать для windows 10 64 bit код ошибки 12
  • Unarc dll вернул код ошибки 6 error file read operation failed что делать
  • Unarc dll вернул код ошибки 6 error file read operation failed как исправить
  • Unarc dll вернул код ошибки 14 walking dead