unauthorized

I'm not able to log in Tomcat Manager App

送分小仙女□ 提交于 2019-12-03 11:21:06
I have read a lot of topics in stackoverflow for solve my problem, but none was useful. When I tried to log in Manager App ([http://localhost:8080/manager/html][1]) using a lot of different configurations, but I always obtained 401 Unauthorized after attempted to log in using the rights credentials. I restarted the tomcat server a couple of times. This is my last configuration in conf/tomcat-users.xml <?xml version="1.0" encoding="UTF-8"?> <tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <role

mvc6 unauthorized results in redirect instead

白昼怎懂夜的黑 提交于 2019-12-03 06:34:50
I have been trying to prevent the redirect when I return an NotAuthorized IActionResult from a Controller, but regardless of my attempts, NotAuthorized gets translated to a Redirect. I have tried what is mentioned here (same issue, using older beta framework, I use 1.0.0-rc1-final). I do not have the Notifications namespace (has been removed in rc1-final). This is my Login Controller: [HttpPost] [AllowAnonymous] public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null) { if (ModelState.IsValid) { var result = await _signInManager.PasswordSignInAsync(model.Email,

Asp.net Mvc custom mechanism to handle unauthorized request

夙愿已清 提交于 2019-12-03 03:47:20
问题 For my website i want following behaviors for secured controller(or action) if a user makes a normal request redirect to login page (which i have easily able to do) if request is Ajax type Request.IsAjaxRequest()==true , return status code 401 How can i create a filter for this?? 回答1: public class MyCustomAuthorize : AuthorizeAttribute { protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext) { //if ajax request set status code and end Response if (filterContext

Redirect if request authorization is failed in Laravel 5.5

心已入冬 提交于 2019-12-02 18:39:08
问题 I am trying to redirect request if authorization is failed for it. I have following code: class ValidateRequest extends Request{ public function authorize(){ // some logic here... return false; } public function rules(){ /* ... */} public function failedAuthorization() { return redirect('safepage'); } } By default I am redirected to the 403 error page, but I would like to specify some specific route. I noticed that method failedAuthorization() is run, but redirect() method does not work...

How do I modify my settings to allow VS2010 to load 3rd party XSD files from the “Unauthorized Zone”?

孤街醉人 提交于 2019-11-30 06:02:18
I have opened a 3rd party XSD file in Visual Studio 2010 that imports namespaces from other schema files from the same 3rd party. In the XML editor view of the schema file, the xs:import element is underlined with the following error: Request for the permission of type 'System.Security.Permissions.FileIOPermission', mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. I read the following blog post: http://blogs.msdn.com/b/xmlteam/archive/2009/06/04/understanding-xml-schema-sets-in-the-xsd-designer.aspx which states that it's a security zone violation and Visual

Redirect Unauthorized Page Access in MVC to Custom View

一个人想着一个人 提交于 2019-11-29 22:35:25
I have an MVC website in which access is based on various Roles. Once a user logs into the system they can see navigation to the pages for which they are authorized. However, some users may still try to access pages using a direct URL. If they do, the system automatically redirects them to the Login Page. Instead of the Login Page I want to redirect them to another view (Unauthorized). Web.Config has the following entry: <customErrors mode="On"> <error statusCode="401" redirect="~/Home/Unauthorized" /> <error statusCode="404" redirect="~/Home/PageNotFound" /> </customErrors> <authentication

ASP.Net MVC 3 Redirect UnAuthorized User not to loginUrl

穿精又带淫゛_ 提交于 2019-11-29 22:24:17
i have a project using ASP.Net MVC3 and using membership for roles. i use authorize in every controller. eg: [Authorize(Roles = "Administrator")] public ActionResult Index(string q, int i) { return View(model); } if someone doesnt have role for administrator, then it will redirect to login page by default. how to change it,so it will redirect into Views/Shared/UnAuthorize.cshtml ? or maybe if someone doesnt have role for administrator, it will show message box (alert) ? thanks in advance. Just change the page that have to be shown in the web.config (check that the route exists) <authentication

How do I modify my settings to allow VS2010 to load 3rd party XSD files from the “Unauthorized Zone”?

坚强是说给别人听的谎言 提交于 2019-11-29 05:26:33
问题 I have opened a 3rd party XSD file in Visual Studio 2010 that imports namespaces from other schema files from the same 3rd party. In the XML editor view of the schema file, the xs:import element is underlined with the following error: Request for the permission of type 'System.Security.Permissions.FileIOPermission', mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. I read the following blog post: http://blogs.msdn.com/b/xmlteam/archive/2009/06/04

Redirect Unauthorized Page Access in MVC to Custom View

空扰寡人 提交于 2019-11-28 17:14:06
问题 I have an MVC website in which access is based on various Roles. Once a user logs into the system they can see navigation to the pages for which they are authorized. However, some users may still try to access pages using a direct URL. If they do, the system automatically redirects them to the Login Page. Instead of the Login Page I want to redirect them to another view (Unauthorized). Web.Config has the following entry: <customErrors mode="On"> <error statusCode="401" redirect="~/Home

Unauthorized when calling Google GCM

£可爱£侵袭症+ 提交于 2019-11-28 10:16:38
I trying to use Google GCM for sending push notifications. But get a WebException that says that the remote server returns 401 unautorized. I can't foung why it doen't work. Anyone that knows why it doesn't work? Here is my code: ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateServerCertificate); HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://android.googleapis.com/gcm/send"); Request.Method = "POST"; Request.KeepAlive = false; string postData = "{ 'registration_ids': [ '"+registrationId+"' ], 'data': {'message': '