473,831 Members | 2,341 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp page authentication

My thanks to Nathan for the code below, but it does not work. I get the
following error;

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/dev/development/WAN RCI Secure/DumpSearch.asp, line 700
Function AuthCheckT

How can I get this to work?

Cheers, Bill.


Use some Javascript code to check the window.opener value. If it is
null, the window was navigated directly to. If it is not null, it will
contain a reference to the window that opened it - you code would look
something like:

<script language=javasc ript>

function doLogin() {
if (window.opener == null) {
document.locati on.href = "default.asp?st atus=timeout";
}
else {
window.opener.d ocument.locatio n.href =
"default.asp?st atus=timeout";
window.close();
}
}

<%
Function AuthCheck()
If IsEmpty(Session ("UID")) then
Response.Write "doLogin(); "
End If
End Function
%>

</script>

The ASP code MUST be inside the script block - the JScript function
will always be on the page, but only when the ASP checks the session
and finds nothing there is the call to the function written up to the
browser. I didn't actually test the Javascript, so it might not be
100% accurate, but you should be able to get the idea.
"William E Hatto" <xx***********@ bigpond.net.au> wrote in message
news:<e9******* ******@TK2MSFTN GP10.phx.gbl>.. .
Hi 1 and all,

I have an asp application/web site that uses a logon page then a page for
the menus and separate asp pages for all the options in the menus.

The options listed in the menu's spawn separate web windows leaving the menu page in the background.

Common to all of these pages I am using authentication. The authentication
function is as follows;

Function AuthCheck()
If IsEmpty(Session ("UID")) then
Response.Redire ct "default.asp?st atus=timeout"
Response.End
End If
End Function

My problem is when authentication is called on a spawned page it takes the
spawned page back to logon. What I want to happen is the spawned page to
close and the menu page return to the logon page.

In the event a page is called without logging on and using the menus I would like the page to revert back to the logon page.

I understand it may require some 'fancy' javascript. I am using some
javascript in my pages, but having only dabelled in it I am unable to use it to the degree it may be required above.

Can this be done, if so how?
Many thanks, Bill.

Jul 19 '05 #1
1 2371
"William E Hatto" <xx***********@ bigpond.net.au> wrote in message
news:eF******** ******@TK2MSFTN GP09.phx.gbl...
My thanks to Nathan for the code below, but it does not work. I get the
following error;

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/dev/development/WAN RCI Secure/DumpSearch.asp, line 700
Function AuthCheckT

How can I get this to work?

<%
Function AuthCheck()


Try removing the "()" after the function name.

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1468
by: William E Hatto | last post by:
Hi 1 and all, I have an asp application/web site that uses a logon page then a page for the menus and separate asp pages for all the options in the menus. The options listed in the menu's spawn separate web windows leaving the menu page in the background. Common to all of these pages I am using authentication. The authentication function is as follows;
2
1732
by: Senthil | last post by:
1. Created a new C# web application project 2. Change the name of webform1 to login.aspx 3. And in the .cs file change the name of the class to login, and include System.web.security namespace. 4. Place a textbox and a button in the login.aspx form. 5. Have the following code in the button click event. if (true) { FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, false)
23
2920
by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the same NT domain, each one has its own web server. The web server is always IIS 5.0.
1
7719
by: Stu | last post by:
Hi All, I have an ASP.NET application to which I have implemented forms authentication to handle security. It is a relatively straight forward solution with all aspx pages residing in the root folder. The issue I am experiencing is that when the authentication time out is activated and the user is hence unauthenticated, the browser window is on sometimes redirecting back to the login page. When the browser does or doesn't redirect to...
1
1812
by: Grey | last post by:
I have set the following parameters in web.config to prevent user direct access the web page without user login. <authentication mode="Forms"> <forms loginUrl="Initial/index.aspx" name="adAuthCookie" timeout="60" path="/" > </forms> </authentication> The application did success to redirect to login page, but it cannot redirect back to desire page which I specify in URL. What's wrong with my
4
1981
by: SB | last post by:
Hi I'm trying to get forms-based authentication to authenticate different users for differet pages, like this: <configuration> <location path="Member" allowOverride="true"> <system.web> <authorization> <!-- allow tags must be first --> <allow users="Admin"/>
8
2251
by: Edward Mitchell | last post by:
I have a main project that is protected in that the user is directed to a login.aspx file. The text in the web.config file is: <authentication mode="Forms"> <forms loginUrl="Login.aspx" /> </authentication> <authorization>
4
1870
by: js | last post by:
I am building a intranet site that has public and private information that are rendered by ASP.Net pages. The site is not partitioned into private/public folders. When users hit the site's URL, no authentication is needed. When the users click a logon button, a Windows logon dialog box should show up. Right now the Windows logon dialog box appears as soon as the browse hit the URL. How can I use page level authentication, instead of...
7
2453
by: Alan Silver | last post by:
Hello, Sorry this is a bit wordy, but it's a pretty simple question... I have a web site, http://domain/ which is a public site, part of which (http://domain/a/) is protected by forms authentication. I would like to configure it so that anyone not logged in, trying to access the protected part will not be redirected to the login page, but
0
9793
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10777
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10534
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10207
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7748
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3963
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.