Retrieve User Name On Other Webpages For Security Reasons?
Jan 29, 2010
once i login using forms authentication, how do i retrieve user name on other webpages for secuirity reasons.
I login in with 'a' and keep getting my windows login with this code?
username = Request.LogonUserIdentity.Name
username = HttpContext.Current.User.Identity.Name
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, false); After doing this, the user is logged in with the txtUser.text
But the question now is, how do i retrieve that user name from Authentication or whatever on other pages? is it possible or not?
Because i know that person stays logged in untill he logs out with this code: FormsAuthentication.SignOut();
And one more question i dont know is this one good for this or not how do i better check if the person is typed in correct name and pasword or not, with executescalar or executereader?
How do I retrieve the UserName for a logged in user? Membership.GetUser().UserName doesn't work for me - Object reference not set to an instance of an object.I need it to get the associated UserID which my own db tables use as primary keyFurthermore, as I am a rookie is the best approach to achieve this through LoggedIn as below?
I'm in the middle of moving a web application from IIS6 to IIS7. I've enabled "Windows Authentication" and added <deny users="?" /> to the authorization section of my web.config file. When the app was running on IIS6 my users where able to access the web app without logging in because their windows login was automatically recognized. This does not seem to be the case in II7. I can not get a value for "Current.User.Identity.Name" in my ASP.Net code.
I have written an application that user the MemberShip provide.
i have a page that needs to retrieve user information, such last activity, isOnlineStatus, CreateDate etc.
when i use the following code the status of the user changes.
[Code]....
i can retrieve all the required information for the user whose GUID i provide in Line1, however irrespective of if the user is online or not the status changes to Online.
i need to get the user details without updating the userIsOnline and the lastActivity stamps.
I am new to asp.net's membership controls. I am trying to figure out how to make a public profile page that will display information about a site member to other users. I thought I would be able to use the profile class and just pass in a parameter such as user name. But I tried:
Profile.GetProfile("username") 'Where username = name of profile I want to retrieve Response.Write(Profile.Title) Response.Write(Profile.Company)
However, if the user is logged in this codee just brings back their details, not those of the username requested. What am I doing wrong?
I have installed an SSL certificate with EV on a website through IIS. I am aware that as the SSL has EV that it can display a 'green bar' on web pages. I want to display the 'green bar' on specific web pages. These web pages sit within a 'SECURE' folder within the website directory. Is there some code I can insert on these web pages for the 'green bar' to display?
I am developing a website that has 2 roles of users.i have made 2 folders for each type of user's web pages. how to imply security so that 1 type of user could not see other user web pages.is thier any other way or i will have to check form the databse for credidentials every time the page is visited?Also let me know why do people put web pages in folders?i am not using sql membership and not even .net classes for role management.
In my application i have 4 screens such as page1.aspx, page2.aspx, page3.aspx, Page4.aspx. I have created user Settings Web Form where the admin Creates username and password for users with access only for particular pages. I have used check boxes to select their accessibility while creating user setting.
<authentication mode="Forms"> <forms loginUrl="Login" defaultUrl="DailyLog" timeout="2880" cookieless="UseCookies" /> </authentication> when i browse my application through local host , it shows Login screen , also validating the credentials , but without entering any credentials if i change my Url at login page from :
http://localhost:49702/Login
to
http://localhost:49702/DailyLog
it goes to DailyLog without confirming the login ...
in Login Screen on Submit button Click event i have done this :
I am utilizing local security groups to secure my application and I need to list all the available groups on the local machine. I can get the list of groups a user is a member of, but I need the complete list of available groups.
I have used session to the creation of user and led them to the edit page ..But how do I retrieve my userID off from the session, or are there other ways to retrieve userID from?
i am working in asp.net and csharp, we have 10 user, but certain user only need to put dataentry. how to enable and disable based on the user to access certain form ,like add, modify view options.
i currently work on an asp.net mvc 2 project and noticed that inside an asp.net mvc view page i can get the user name authenticated via User.Identity.Name, but if i try to use the DsiplayFor method in order to display my model from a view user control, it just does not exist. Could i pass this parameter to my model using additional ViewData parameter that comes with DisplayFor html extension?
when an aspx webpage retrieve data from an sql database into variables can it use the data in the variables for other users or does it has to reretrieve the data from the sql for each user ?
In my visual studion 2005 i just create new folder for resume uploading. i just upload some resumes in this folder... now i want to retrive the resume for paricular user..how can i ? is ther any need to create table for storing path name and retrive ...Just explain if possible provide code for retrive resume from folder in vs 2005 in asp.net
I could retrieve current username, but how Could I get CurrentUserID. I ma using builtin asp.net membership provider and UserID field is UniqueIdentifier.
Once the user has authenticated, I would like to base all of the information displayed to the user based on their username. Isn't that saved in the cookie?
For instance, I would like to pull all of their client information using a GridView and have the parameter set to the appropriate authentication information.
I am trying to integrate my asp.net 4.0(non MVC) website with facebook. I want to retrive the authenticated user info.The samples listed in facebooksdk is based on MVC. i tried to implement it in my website, but getting errors. i am struck.If anyone implemented the facebook connect logic and retrieved the user information using facebook-c#-sdk, please help me how to do this.I tried the same using facebooktoolkit, and i am able to retrive the user info. but the toolkit is having issues with .net 4.0.