Security :: Redirect From Web.config When Forms Authentication Failed?

Mar 7, 2011

I am using forms authentication to authenticate users. Application has multiple folders and one of the folders has its own web.config

[Code]....

I want to redirect the user to "info.aspx" instead of "login.aspx"Root has the following web config

[Code]....

View 8 Replies


Similar Messages:

Security - Forms Authentication Without Redirect?

Feb 2, 2010

I am using ASP.Net's forms authentication, but do not want the default behavior of redirecting to a login page when a restricted area is accessed. Instead I would like to invoke a javascript JQuery dialog for the login on the current page, preventing the content behind from loading.My only issue is that by default the forms authentication wants to redirect. Is there a handler that I can hook into, or some other option to prevent the redirect?

View 3 Replies

Security :: Redirect URL And Forms Authentication (VS2010)?

Jul 12, 2010

We just switched to VS2010 and seems like the forms authentication is behaving differently.

Our setup is that we have a default page (default.aspx) so that if you link to the root folder of the site, rather than a specific page, you get switched to default.aspx.

In addition, we have a working forms authentication system set up so that if you try to go to any of the pages you get redirected to a login.aspx page.

The login page can either redirect you to the forms authentication default page (default.aspx) or to the requested URL.

I'm not the one that configured this originally, but it looks like we are getting the originally requested URL from the authentication redirect, since Page.Request.Url = "http://.../Login.aspx/ReturnURL=<requestedpage>"

The problem is that this is failing to work when the original url is the root folder. In VS2008, <requestedpage> would be "/rootfolder/default.aspx", whereas now (in VS2010) we're getting "/rootfolder/". In other words, the site redirect used to be happening before the authentication check, and now it seems to be happening afterwards.

This is a problem because when we are checking to see if we need to redirect to something other than the default page, we check to see if the return URL is empty or matches the authentication defaultURL (which is also "default.aspx". If it matches, we go straight to the default page. If it doesn't we do some processing and then do the redirect. The extra processing is producing strange results when the browser is redirected to the rootfolder and therefore to the default page.

For now, I'm able to additionally test for Request + "default.aspx" (which resolved to the authenticaiton defaultURL), but this feels clunky and I can see headaches in the future if we ever need to rename default.aspx.

P.S. It has occurred to me that it's possible that something changed in web.config or another setup file when we did our conversion to VS2010. I can't find it, but that doesn't mean it's not there.

View 2 Replies

Security :: Redirect On Forms Authentication Timeout?

Nov 3, 2010

how to redirect to a custom URL on Forms Authentication timeout? The timeout is working but it is only caught when I try to go to a page in my application because each Page_Load method is wrapped in a custom IsLoggedIn method. Here is the settings I have so far in the Web.config.

[Code]....

View 1 Replies

Security :: Forms Authentication Across A Subdomain And The Redirect URL Failure?

Apr 9, 2010

Here's my scenario.

I've got a site called domain.com and also another product on product.domain.com. The product.domain.com requires authentication to access it. For consistancy in the user experience I have set the login url in the web.config on product.domain.com to be http://domain.com/Login.aspx. This redirection is working ok - and a sample url would be:

http://domain.com/Login.aspx?RedirectURL=/default.aspx

The problem is that the RedirectURL does not take into account that the request originally came from product.domain.com so when the authentication is successful the user is not redirected back to product.domain.com

I have come up with a solution for this but would like feedback if possible.

I changed the loginURL in the web.config to http://domain.com/Login.aspx?domain=product.domain.com so the sample url is now:

http://domain.com/Login.aspx?domain=product.domain.com&ReturnURL=Default.aspx

I then override the LoggedIn event in the membership control and check to see if the domain value pair is specified and if it is I redirect to the domain + ReturnURL.

As I said previously i'd appreciate any comments or other ways to achieve the same result.

View 1 Replies

Security :: Event Viewer Information Message / Forms Authentication Failed For The Reques

Aug 18, 2010

I've made a for a web app to use sql server session state, in the event viewer I get a re-occuring informatation message:

Event code: 4005

Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.

Event time: 17/08/2010 10:37:01
Event time (UTC): 17/08/2010 09:37:01
Event ID: 623a3b87c23541b9b8b49d9a9a167bde
Event sequence: 7699
Event occurrence: 124
Event detail code: 50202

Process information:
Process ID: 10188
Process name: w3wp.exe
Account name: NT AUTHORITYNETWORK SERVICE

User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITYNETWORK SERVICE

It dosnt seem to be causing any problems, just filling the event viewer...

View 3 Replies

Security :: Forms Authentication Failed For The Request. Reason - The Ticket Supplied Has Expired

Jan 25, 2010

we recently upgrated our project from 1.1 to 2.0. since then we are seeing "Forms authentication failed for the request. Reason: The ticket supplied has expired" in Event Viewer. this keeps coming 1-2 times for every minute. this is the full message. this also made the response time increased it seems.

Event code: 4005

Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.

Event time: 1/25/2010 5:00:30 PM
Event time (UTC): 1/25/2010 10:00:30 PM
Event ID:
Event sequence: 20601
Event occurrence: 2692
Event detail code: 50202.....

View 1 Replies

Security :: Set Forms Authentication To Website To Web.config File?

Mar 8, 2010

when i set forms authentication to my website to web.config file as

<authentication mode ="Forms">
<forms
loginUrl="login.aspx"></forms><authentication><authorization><deny
users="?"/></authorization>

and login button ,i write the following code

FormsAuthentication.RedirectFromLoginPage("login",
false);

and logout button ,i write the following code

FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();

it works but when i press browser back button after logout button click

it maintains the page history and the page will redirect to last requested page

View 7 Replies

Security :: Changing Failed Authorization Redirect Page?

May 12, 2010

Currently, when the authorization fails, it redirects to the login page by default. However if the user is logged in, it makes no sense to be redirected to the login page. I would like it to be redirected to an eror page instead.

View 5 Replies

Security :: Windows Authentication - Get Role Security In Web Config File To Coincide With Controls

Apr 6, 2010

We use Sharepoint to control our websites. We build the sites, then load them into the sharepoint server. My question is if I use windows authentication, how can I get my role security in my web config file to coencide with the asp.net controls that use the Forms authentication. Is there a differenence? Our security uses a session variable for security but there is no where to set up their permissions except in active directory. I hope this makes sense because I would like to implement the LoginView with Role groups but how can I give them the role="administrator"? Do I have to go into active directory and give them these permissions(would take awhile due to the size of the company)? Or do I have to set up priveladges in the web.config file for each user(difficult I think)?

View 5 Replies

Security :: Login SSL Confusion / Forms Authentication Section In The Web.config To Use SSL?

Apr 15, 2010

I have a few pages that need to use SSL and I am confused bc I read you should set the forms authentication section in the web.config to use SSL. so if this is the case, the user logs in (login page is using ssl) the forms auth cookie is created and now if i redirect to the non ssl enable home page, does this mean the auth cookie will not be transmitted, so i can't display like a welcome module or know the username of the user who logged in?

View 6 Replies

Security :: Authentication - Redirect URL For Different Roles?

Mar 10, 2010

I am currently having a spot of bother in something im trying to create. I want it so when a user who is in a certain role logs in they are directed to a certain page, and any other normal users are directed to another page.

I think i have this sorted via code but...

-The first time it will work, the 'admin' user will get directed to the appropriate page

-I then log out and log in as a normal user and get directed to the appropriate page

-then when i log out of that users account and back into the admin one i get directed to the normal users page instead.

-additional to this, I tried it on a different machine logging in as the admin user only to be redirected to the normal users page (is my session being stored somewhere?)

Ive traced through the problem and the user name and password being subbmitted are what they should be, yet it skips the true part of my IF statement for being in that role.

Here is my code I am using on the login form:

[Code]....

-When stepping through if seen it work and not work with the same values, I cant understand the logic of its inconsistency

the code i am using for the logout is (this is on my masterpage):

[Code]....

View 4 Replies

Security :: Forms Authentication In Web.config / Access To Folder Be Made Via Login Form?

May 28, 2010

i have a problem with forms authentication. i have a website and want to restrict access to an especific folder. i want the access to this folder be made via the login form this is what i have in the web.config

<authentication mode="Forms">
<forms name="Compra" loginUrl="wfLogin.aspx" path="/" protection="All" timeout="30" />
</authentication>
<authorization>
<allow users="*"/>
</authorization>

Then this to restrict folder

<location path="Admin">
<system.web>
<authorization>
<deny users="*"/>
</authorization>
</system.web>
</location>

the problem is that when the user login with valid information the website return to the login form.

View 7 Replies

Security :: Authentication In Web.config?

Apr 7, 2010

Im uysing my custom login for user,and suppose im having a group of user who can login in.and rest of other should be deniedso how i can maintain that in web.config,

View 2 Replies

Security :: Login Failed For User ' Only With Parameterized Query Using SQL Server Authentication

Nov 29, 2010

I've narrowed the problem down to the following:

Receive "Login failed" for user ASPNET error message SQL Server 2005 is db and IIS is web server (both on same computer) Mixed authentication used on SQL Server I have created user ASPLogin with password that is correctly typed int the web.config:
add
name="masterConnectionString"
connectionString="Data
Source=computernameGMOSERVER;Initial Catalog=Portal;Persist Security Info=True;User ID=ASPLogin;Password=password" providerName="System.Data.SqlClient"
/>

I am able to access my webpages that query the database as long as they are not parameterized.However, the parameterized queries (e.g., SELECT * FROM SUPP_DASH_RESULTS WHERE organization_code = @orgcode) are the ones that do not work, and give me the "Login failed" error message

View 5 Replies

Security :: SiteMinder Authentication - Redirect From One Application To Another?

Jun 4, 2010

I have a web application that is using siteminder for authentication.

I want to redirect to application that is siteminder enabled. This application might be using site minder forms authentication.

What parameters i need to pass to that application? And what details i will need of that application.

View 1 Replies

Security :: How To Redirect Page If Authentication Fails

Aug 12, 2010

we would like to redirect the user to a given page if the authentication to our SharePoint site fails (i.e. the standard windows login prompt pops up three times - we are using windows authentication). No matter what option we try it always ends up bringing the user back to a blank page.

We have tried writing a HttpModule (and catch the if Response.StatusCode = 401), which doesn't seem to fire any events if the user is not authenticated. We have tried writing a HttpHandler, but of course we can redirect the user if there is an error code but can't continue onto the desired site if not. We have tried doing the following in the web.config:

<customErrors mode="Off">
<error statusCode="401" redirect="http://social.msdn.microsoft.com"/>
</customErrors>

Which doesn't work, again taking us to a blank page.

View 3 Replies

Security :: Catch A Failed Login Attempt (Windows Auth) And Redirect To A Forms Login Page?

May 26, 2010

I need to create an application with Forms Authentication and/or Windows Authentication. If the application is set to use mixed authentication (Forms + Windows Auth) and the user don't have a Windows user account, the login will fail and he must be redirected to a forms login page. How can I do this?

Are there any different way to provide mixed authentication?

View 1 Replies

Security :: Authentication In Web.config Not Working?

Feb 2, 2010

I have a basic intranet website for my company but there is one page that cannot allow anonymous as I need to grab the user's login. I created the site and everything works perfectly on my development machine. once moved to the production server it no longer works.

Here is the problem: I can get the login prompt when going to the secure page, but when trying to login I get a "401.1 - Unauthorized", even when trying to login as a server administrator. Here is the authentication portion in my web.config:

[Code]....

I have done this before and always gotten it to work. I hope I am just missing something very simple...

View 5 Replies

Security :: Authentication And IP Access Through Web.config?

Mar 30, 2011

I need to put windows authentication on a site (so when a user access the site they are prompted with a username/password box) but I need certain IP addresses to bypass this authentication.

View 2 Replies

Security :: Digest Authentication In Web Service Error / The Request Failed With HTTP Status 401

Apr 20, 2010

I am connecting to remote server for web service using ASP.NET 3.5 web site. something like, [URL]. Remote server is providing digest authentication to access the web service. I dont have access to modify authentication on the remote server but I have an windows account on that server. If I try to Access service WSDL through programming I get the following error:

The request failed with HTTP status 401: Unauthorized. Same web service if I try to access through browser, [URL], it asks for user name and password. Entered windows account user name and password, still getting error: You are not authorized to view this page, HTTP Error 401.1 - Unauthorized. How to pass the digest authentication credentials to the web service through visual studio or any other programmatic method?

View 1 Replies

Security ::redirect If A Folder Is Protected By A Web.config File?

Jun 9, 2010

There are some folders in my application that are only accessible by users in certain roles.In order to protect the contents of these folders, I placed web.config files in them which look like so:

[Code...]

Also,in the main web.config file, I have this configured:

[Code...]

However,when I try to access a folder that I'm not authorized to access, I'm not being redirected to unauthorized.aspx page as indicated in the main web.config. Instead,I'm getting sent to the login page.Any idea what I'm doing wrong? Here's the authentication section from the main web.config:

[Code...]

View 6 Replies

Security :: NT Authentication Fails Redirect To Default Page

Dec 16, 2010

I am in the process of designing application in case user authentication if failed i need to redirect to default page (NT Authentication). Is there any way you can redirect the user on IIS if the user is fail go through the NT authenticaiton at IIS level.Options 1 : Always land the user to defalut page and validate there and redirect to site based on the access give the directory level access. I am looking if there any options to let the user to default page in case user access is denied.

View 4 Replies

Security :: Forms Authentication Failed "The Ticket Supplied Was Invalid" For Users Using A Proxy?

May 11, 2010

Since we updated our website to .NET 4.0, users using a proxy-server can't login in our webapplication anymore.In the event-viewer on the server this error is thrown:Forms authentication failed for the request. Reason: The ticket supplied was invalid.This problem only exists for users with a proxy, all other users can login normally.We are not using a web garden or multiserver (load balance) environment, just a webserver and a databaseserver.

View 4 Replies

Security :: Response.Redirect To Current Page With Cookieless Authentication?

Mar 30, 2011

I have a logon/register control that is on several pages. Users are logged on with code: - FormsAuthentication.SetAuthCookie(Userid, False) Response.Redirect(Request.Url.AbsoluteUri) ' Round trip is necessary to complete logon

All this was working OK, except that there was a problem with Internet Explorer users: if their browser had the default privacy setting the authorization cookie was rejected. There was no message, but they were not logged on. See [URL] To try to solve this problem I changed to cookieless authentication, but now the logon control doesn't work. The problem is that after cookieless authentication the URL changes from

[URL]

However Request.Url.AbsoluteUri remains http://localhost:3641/TestGDB/login_pages/home2.aspx even after the logon, and so with cookieless authentication the user is not logged on as there is no authentication ticket in the redirect URL.

The problem is "solved" by changing the Redirect statement to Response.Redirect("~/login_pages/home2.aspx") which works perfectly for this particular page, but is obviously wrong when the control is on other pages.

How do I write "Response.Redirect(current page)"?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved