How To Determine If Web Request Is To A Resource That Allows Anonymous Users Or Not
Jul 23, 2010
I have denied anonymous access to the entire application using the following Web.Config setting:
<authorization>
<deny users="?" />
</authorization>
Then, for various paths, I have allowed anonymous access using Web.Config settings such as this:
<location path="Home/ShowLogin">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
I'd like to be able to determine during the processing of a given request whether the requested URL is to path that allows anonymous users or whether the request is to a path that denies anonymous users.
What is the most elegant way of determining this?
View 1 Replies
Similar Messages:
Jan 21, 2010
I there a way to know if a request is a soap request on AuthenticateRequest event for HttpApplication? Checking ServerVariables["HTTP_SOAPACTION"] seems to not be working all the time.
public void Init(HttpApplication context) {
context.AuthenticateRequest += new EventHandler(AuthenticateRequest);
}
protected void AuthenticateRequest(object sender, EventArgs e) {
app = sender as HttpApplication;
if (app.Request.ServerVariables["HTTP_SOAPACTION"] != null) {
// a few requests do not enter here, but my webservice class still executing
// ...
}
}
I have disabled HTTP POST and HTTP GET for webservices in my web.config file.
<webServices>
<protocols>
<remove name="HttpGet" />
<remove name="HttpPost" />
<add name="AnyHttpSoap" />
</protocols>
</webServices>
Looking at ContentType for soap+xml only partially solves my problem. For example,
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 1131
Content-Type: text/xml
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: ro
Host: localhost
mymethod: urn:[URL]
Some clients instead of having the standard header SOAPAction: [URL], have someting like in example above. "mymethod" represents the method in my web service class with [WebMethod] attribute on it and [URL] is the namespace of the webservice. Still the service works perfectly normal. The consumers use different frameworks (NuSOAP from PHP, .NET, Java, etc).
View 4 Replies
Sep 22, 2010
I am working on an internal application... i setup IIS 7 to use windows authentication since its behind the firewall and on the domain.. there is a "public" side.. and an "internal" side... if your not part of IT.. you should get the public side.. this is just informational.. my problem is that there is 1 or two pcs that are not on the domain and nobody is logged into them.. how can i just redirect anonymous users to another site?
everything i read says you can't use anonymous AND windows auth.. so my thought was to just redirect the anonymous users to another site.. how can you do that?
View 1 Replies
Feb 4, 2011
I'm trying to add a directory for anon access in IIS 7.5. It works under Web Dev but not IIS 7.5
I'm currently using this web.config in the directory. This is a directory with style sheets:
<?xml version="1.0"?>
Note: As an alternative to hand editing this file you can use theweb admin tool to configure settings for your application. Use the Website->Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in WindowsMicrosoft.NetFrameworkv2.xConfig
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</configuration>
Update:
I've went to the folder and under Authentication, I've changed anonymous authentication from IIS_USR to pool. This seems to have correct it.
I will reward anyone who provides a very good explanation and resources for understanding this setting. Also, how to apply it globally would be good to know -- for all folders.
View 2 Replies
Jan 17, 2010
Is there an easy way to cache ASP.NET whole page for anonymous users only (forms authentication used)?
Context: I'm making a website where pages displayed to anonymous users are mostly completely static, but the same pages displayed for logged-in users are not.
Of course I can do this by hand through code behind, but I thought there might be a better/easier/faster way.
View 1 Replies
Feb 14, 2011
I am using windows authentication in my web application. All we need is when the application will be executed it will launch login.aspx page. If users put correct userid and password(checked from active server directory) it will be redirected to a difference page. But if any unauthenticated user tries to access any other page in the application by typing the Url on the address bar it will be again redirected to the login page. We have to do this by changing our web.config file.I can achieve this using form authentication but not windows. But our requirement is windows. The requirement is very basic but all effort is just not working.
View 2 Replies
Mar 9, 2011
I would like to ask if somebody knows how to deny view of page in the telerik rad menu to anonymous users. So if the user wont be leged in then he wont be alble to see a page in the rad menu, but when he log in the the page show up in the menu.
View 2 Replies
Mar 26, 2010
in my aspx.vb page i have written
Label1.Text = Me.Page.User.Identity.Name
when i do view in browser (without publishing to any server) i see label's text as
abcxyz which is correct
but when i publish it, i dont see any text . I have made setting IIS to allow anonymous users so that anyone can open the wesite and see their computer login id
like abcxyz
View 1 Replies
Mar 2, 2011
I have a E-Shop Site and I need some customization for my users like following :
Store favorite products in their own basket.Customize products list in order to what are their favorite. It must remember their basket next time they want to visit our site.
my question is how I can store information for my customers who are new to my web site also most of customers don't like to have username and password then login first they like to buy during a week and at the end of week pay for them then we can send some products to their locations.
I have already written my application using asp.net with framework 4.0.
View 3 Replies
Feb 24, 2011
I am getting following error in the Test which is in the same Box but IIS requires Https to view the Page. I have change Web.Config to accept https. I was able to add the Service References without any problem but while call the method I get The HTTP request was forbidden with client authentication scheme 'Anonymous'. this error message. I am trying to use userNameAuthentication.
<bindings>
<wsHttpBinding>
<binding name="Binding1">
[code]...
View 1 Replies
Aug 4, 2010
I have a user control which, when pressing a command button, sets a property for the Profile (which has been marked as allowanonymous=true), then save it using Profile.Save().
Now, in IE this works fine - no problems at all. I then go to the page where the value is used - and it's there and can be used.
However, exactly the same routine when running in Safari or Firefox doesn't work - although when you're on the same page where the value is set it will immediately state that the value is ok, do a postback and it's gone!
Here's some very simple code to show the problem. Whilst IE will always dump 'plop true/false' to the screen (yes, I know - very juvenile!), FF and Safari will the first time, but on postback will just dump True to indicate it's a postback. (oh, and autosaveprofile is set to true in this example - otherwise there'd be a Profile.Save() below the set property).
[Code]....
I can't use Cookieless session states as the CMS I'm using won't allow it. I've also used Fiddler to try and track the issue, but no joy.
I'm guessing it's related to the way FF and SF handle cookies - but both are set to accept anything. Could it possibly be anything to do with the ASP.Net Development Server? (ie. the address is[URL]The fact that it never manages to save the value
View 1 Replies
Aug 5, 2010
I'm implementing a custom page caching solution and I don't want the request to be cached or retrieved from the cache if it's in response to a form submission or some sort of asp.net postback.I'm trying to figure out if the current HttpRequest is a postback. Is there a way of doing this outside the context of a page or other usercontrol? In otherwords if I'm inside an HttpModule I don't have access to this.IsPostBack but I still need to determine if it is in fact a postback.
View 5 Replies
Apr 5, 2010
Just wondering if anyone has any idea how you can determine how many bytes of a request have been read/received by the server... In other words how do I stream http request...
In that, users are uploading files and I want to report on a perotic basis how many bytes have been read/received so far.
View 2 Replies
Jun 19, 2010
I am working on a component in C# to record how many unique viewers have viewed my website / page, making certain the same user revisiting, is not recorded twice. What is an efficient method to write such a component? Do you track cookies or session objects?
Would I record their ip address (which is not static) or computer name?
This information would be stored in a database (as far as I know)
View 6 Replies
Sep 15, 2010
Given a set of uploaded files in Request.Files, how do figure out which form field yielded which file?
I have a generic form emailer that various forms post to. This file generates an email of the name/value pairs contained in the form post. I'm trying to add support for uploaded files such that the table of name/value pairs will show the name of the file upload element and the name that the file was saved as.
However, I can't figure out how to link that information together. HttpPostedFile doesn't contain any information about the HTTP request (like which field name was used), and Request.Form doesn't contain any entries for uploaded files.
So while I can easily upload the files, I don't have an easy way to generate an email saying "this uploaded file was for this field, and this uploaded file was for that field".
View 1 Replies
Jan 8, 2010
We have a Web Application (WebApplication A) which is in place and serving fine, we are working on another WebApplication which will use the Engine of Existing Web Application (WebApplication B) to some extent.
Problem: WebApplication A responds when a http request is made for a resource, like LatestPost.aspx, which passes it down to relevant class / Module like FrontManager.cs. I want to know how can we access that Module / class (FrontManager.cs) from WebApplication B, without requesting a Web Page ?
View 2 Replies
Apr 13, 2010
I'm a newbie to .NET and hope someone can help me.I have written two files aisle7.aspx.vb and aisle7.aspx.When I try and view the page http://www.servername/aisle7.aspx I get the following errorDescription:An error occurred during the compilation of a resource required to service this request.Please review the following specific error details and modify your source code appropriately.Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).I've spoken to the suppliers technical side who say that the code withing the .vb page is exactly how it should be but I cannot get the page to work.The start of the aisle7.aspx.vb file reads
[code]...
View 7 Replies
Sep 18, 2010
i have the fallowing Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS0246: The type or namespace name 'NVPAPICallerOtpoaz' could not be found (are you missing a using directive or an assembly reference?)
[code]...
View 1 Replies
Jan 24, 2016
I try to add a new web api to my .net application and place it on Azure (where all my APIs are).
The new API is getNumbers:
public class GetNumbersController : ApiController
{
[HttpGet]
public List<string> GetNumbers(string planeType)
{
...
} }
For some reason i can't access it. when i type the url [server]/getNumbers i receive:
<Error>
<Message>
No HTTP resource was found that matches the request URI 'http://aeronexus-we.azurewebsites.net/GetTailNumbers'.
</Message>
</Error>
Of course that all my other APIs build the same and are accessible
I even can't see my new API under
[server]/help (where i can see all the others)
Locally I can access my new API
The routes is:
config.Routes.MapHttpRoute(
name: "ActionApi",
routeTemplate: "{controller}/{action}/{id}",
defaults: new {id = RouteParameter.Optional})
View 1 Replies
Aug 2, 2010
I uploaded a few new pages to a web site and now I am getting these errors no matter what I try. Parser Error
Description:
An error occurred during the parsing of a resource required to service this request. review the following specific parse error details and modify your source file Parser Error Message: Could not load type 'PSR.MasterPage2'.
Source Error:
[Code]....
Source File: /MasterPage2.master
View 10 Replies
Oct 13, 2010
I have an asp.net 3.5 website that has been running fine on a server for over 2 years, no changes at all.
Never had any problems, but this week I started getting the following errors:
This is an invalid script resource request.
System.Web.Extensions.
This causes my pages to throw a 404 error.
View 2 Replies
Jan 18, 2010
I am currently implementing a client-side paging solution using ASP.NET, jQuery and JSON.
I have been following the excellent article from encosia: http://encosia.com/2008/08/20/easily-build-powerful-client-side-ajax-paging-using-jquery/
In my Web Method I retrieve my data from the database as a DataTable:
DataTable categoryProducts = ProductViewerAccess.GetCategoryProducts
("AA", 4, 0, Page.ToString(), out howManyPages, "FALSE", 0, "CostPrice", "asc", destinationList);
I then retrieve the data from the DataTable into an anonymous type:
var feeds =
from feed in categoryProducts.AsEnumerable()[code]....
This all works great.
However, I would like to extend the code to perform some evaluation checks (e.g., check that various columns in the DataTable are not NULL) and other pre-processing (e.g., call various functions to build the image URL based on the image ID - which is another column in the DataTable not shown in the code fragment) before I return the resulting rows of the DataTable as an anonymous type to the client-side.Basically, I want to iterate through the DataTable, perform the evaluation checks and pre-processing, while building my anonymous type manually as I go. Or maybe there is a better way to achieve this?
View 2 Replies
Oct 4, 2010
There is a Compilation Error at the web site located at http://cforedu.comDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
View 13 Replies
Jan 12, 2010
I have a web page where I am denying anonymous users from accessing. In the web site I have a folder called FileManager. In the web app the usres have the ability to uploaded files and when they do a folder gets created under the filmanger and the files are saved. I have created a web.config in this folder that denies anonymous users. The problem is if the user knows the directory structure they can type in the url of the site add /FilManager/x/x/NameOfFile, where x are the sub directories. If the file is an image it shows the image in ie, if it is a .xls or .doc or what ever they get the prompt to either download or save the file. What am I doing wrong. Will the web.config file not stop an anonymous user from access files? I put a webpage in the folder and it is blocked and the user gets sent to the login screen, but files seem to be unsecured.
How do I block anonymous users from being able to access the files in this folder?
View 4 Replies
Oct 29, 2010
[Code]....
[Code]....
Compilation Error Description: An error occurred during the compilation of a resource required to service
this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0122: 'NovPotniNalog.CustomersGridView_RowDeleting(object, System.Web.UI.WebControls.GridViewDeleteEventArgs)' is inaccessible due to its protection levelSource Error:
[Code]....
Line 202:<div>Line 203:Line 204: <asp:GridView ID="ViewRelacije" runat="server" Line 205: BorderWidth="0px" Line 206: AutoGenerateColumns="False"
I want to delete a row in a way that it shows, but displays an error.
View 3 Replies