473,671 Members | 2,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble accessing .NET 2.0 Membership stuff from HTTP Module

I am trying to create an HTTP module to run on ASP.NET 2.0. The module needs
to check to see if the user is authenticated with the .net 2.0 membership
stuff. I am trying this:

If application.Con text.User.Ident ity.IsAuthentic ated Then
app.Context.Res ponse.Write("us er authenticated")
End If

I get a "Object Reference not set to an instance of anobject." error on
application.Con text.User.Ident ity.IsAuthentic ated.

I am always getting an error. Does anyone have any suggestions? Do I need
to configure anything special for the module? Thanks.
Nov 19 '05 #1
2 1219
You should look into handling the PostAuthenticat eRequest event instead.
That way you don't have ordering issues with the other modules during the
AuthenticateReq uest event.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am trying to create an HTTP module to run on ASP.NET 2.0. The
module needs to check to see if the user is authenticated with the
.net 2.0 membership stuff. I am trying this:

If application.Con text.User.Ident ity.IsAuthentic ated Then
app.Context.Res ponse.Write("us er authenticated")
End If
I get a "Object Reference not set to an instance of anobject." error
on application.Con text.User.Ident ity.IsAuthentic ated.

I am always getting an error. Does anyone have any suggestions? Do I
need to configure anything special for the module? Thanks.


Nov 19 '05 #2
Thanks. That fixed it.

"Brock Allen" wrote:
You should look into handling the PostAuthenticat eRequest event instead.
That way you don't have ordering issues with the other modules during the
AuthenticateReq uest event.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am trying to create an HTTP module to run on ASP.NET 2.0. The
module needs to check to see if the user is authenticated with the
.net 2.0 membership stuff. I am trying this:

If application.Con text.User.Ident ity.IsAuthentic ated Then
app.Context.Res ponse.Write("us er authenticated")
End If
I get a "Object Reference not set to an instance of anobject." error
on application.Con text.User.Ident ity.IsAuthentic ated.

I am always getting an error. Does anyone have any suggestions? Do I
need to configure anything special for the module? Thanks.


Nov 19 '05 #3

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

Similar topics

0
819
by: lanem | last post by:
I am trying to create an HTTP module to run on ASP.NET 2.0. The module needs to check to see if the user is authenticated with the .net 2.0 membership stuff. I am trying this: If application.Context.User.Identity.IsAuthenticated Then app.Context.Response.Write("user authenticated") End If I am always getting an error. Does anyone have any suggestions? Do I need to configure anything special for the module? Thanks.
6
1460
by: matt | last post by:
hello, im working on my first public-facing ASP.NET 2 website, and i have a question/concern about authentication integration. in ASP.NET 1.1, one would typically go w/ a "role yer own" webforms/database role-based model: in your db youd have a Users table, a RoleGroups table, a UserRoles table (see http://aspnet.4guysfromrolla.com/articles/082703-1.aspx).
5
1225
by: Ryan | last post by:
I have a SQLDataSource I want to tie to the currently logged in user. Is there any way to use User.Identity().Name as a Parameter in the datasource? The only way I've got this to work is by creating a label (label1) and OnInit() setting label1.text = User.Identity().Name. Then I can set the SQLDataSource parameter to the value of the control, label1. Thanks, Ryan
4
4725
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality above and beyond what the prodiver currently allows. I need the ability to access a user id and the user's permission id. With Forms authentication in 1.1, I would just create a custom identiy and principal and store the information in the identity....
3
1618
by: daokfella | last post by:
I'm just starting to dive into the new membership stuff and wondering if it is possible to customize the default membership architecture in ASP.Net 2.0 to do the following: Instead of UserName and Password for the login account, I want E-mail Address and Password as the main login credentials. I'd also like to store additional info such as Name, Address, Nickname, and Bio. I also want the e-mail address and nicknames to both be unique. ...
13
5306
by: Kirk | last post by:
I have been reading Scott Allen's article on Master Pages (http:// odetocode.com/Articles/450.aspx) but I am having problems understanding a concept. Specifically, I have created a property (called "CurFlag") on my master page that can be accessed from content pages, but not from separate code modules. I tried doing something like this in my VB code module: Dim myMaster As MasterPage = CType(ProjectMgmt.Master, MasterPage)
1
943
by: Cirene | last post by:
I am creating an ASP.NET 2.0 website. Rather than using all the membership functions I wanted to just create my own SQL Server db and use SESSION vars to track if the user is logged in etc... Is doing it in this way just as secure? I know that the "membership" stuff will save me some coding, but I was just thinking.... Thanks.
3
1124
by: Andy B | last post by:
I have 2 web applications that need membership added to them. 1 is an admin module for the admin to control the website and the other one is contracts module where customers/clients can login and manage their contracts. I want to use 1 centeralized membership provider and database for the usernames and passwords but don't want clients/customers to have access to the admin module. How would I do something like this?
1
1236
by: Jeff | last post by:
Hey ASP.NET 2.0 At work my boss have given me the task of developing a new website. Users will be able to register at the website and gain exclusive access to some information etc... Some users will have limited access to the information and some users (Administrators) will have total access. There will be 3 levels of users: Normal User, Power User and Administrator.
0
8473
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
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
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
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
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...
0
4402
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.