473,378 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Login Related Problem

Hi all

1. When allowing a user to change their username the system still has the
original username in the 'User.Identity.Name'
and this property is Read Only

2. Related question how can I set the user as logged without using the
'FormsAuthentication.RedirectFromLoginPage(txtUser name.Text, False)' method
Thank you,
Samuel
Oct 17 '06 #1
1 1021
Question 1 - make sure you set authenticate type to 'forms' or 'none' in the
web.config file, then attach CustomPrinciple to current request.

sloppy quick way: store in session

middle ground: Use the global.asax OnAuthenticate method to authenticate
the user. Create a CustomPrincipal object and attach it to the current
thread, then the IsAuthenticated will be true.

example: (in the global.asax OnAuthenticate method)

-- authenticate user against db, file, etc..... then...

CustomIdentitiy id = new CustomIdentity("myName");
string[] roles = { "role1", "role2" };
CustomPrincipal p = new CustomPrincipal(id, roles);
HttpContext.Curent.User = p;

better way: create a class that implements IHttpModule and do same as above
in the OnAuthenticate method.

"Samuel Shulman" wrote:
Hi all

1. When allowing a user to change their username the system still has the
original username in the 'User.Identity.Name'
and this property is Read Only

2. Related question how can I set the user as logged without using the
'FormsAuthentication.RedirectFromLoginPage(txtUser name.Text, False)' method
Thank you,
Samuel
Oct 17 '06 #2

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

Similar topics

4
by: Sniffer-Dog | last post by:
Hi I just wondered if anyone can spot anything wrong with the following? I have now added the session_start(); as the first command in the code to all the pages needing it. When I click on a...
0
by: Mike | last post by:
I can not figure out what is going on here. I hope somebody can please help!!! I've got an intranet ASP3 application running on a Win2k server. This application requires a login, so the user...
0
by: love_norip | last post by:
I have encountered a problem when I try to visit a web page (like http://www.xxx.org....?arg1=x&arg2=x&....) using HttpWebRequest and HttpWebResponse and related methods .NET provides.The code is...
3
by: Dave Smithz | last post by:
Hi there, I have a website where users can log into. This users sessions as I believe most people use when implementing a login section of a website (each php page first checks a valid parameter...
2
by: Adnan Al-Ghourabi | last post by:
Hi, We have an application running on IIS 6.0, on a windows 2003 box. The back-end database, a SQL Server 2000, runs on anohter server, windows 2000. We have enabled integrated authentication,...
10
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi In my app I have a SplashScreen, a login form and a main form. On launching the app, I'd like to show the SplashScreen while reading config files and attempting a database connection. I show...
3
by: harsh9892991141 | last post by:
every time enter my login id and password in my index page it shows me the error 404 Object not found! The requested URL was not found on this server. The link on the referring page seems to be...
2
by: =?Utf-8?B?d2R1ZGVr?= | last post by:
I have a website using windows integrated security, with anonymous access turned off. The site is used to query orders from a database and when the search takes a long time, a windows login box...
9
by: Josh | last post by:
I run a Joomla website and am familiar with php in some but not all aspects. Currently I am trying to find some solutions related to session handling. Am I correct in saying that "login" is kept...
2
by: Mike Endys | last post by:
Hi all, have problem to use login to the web service. Im thinking about the web service that provides datas and files to the WinForm Client. I want the client log-in to the application... here...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.