Obtaining The SecurityIdentifier (SID) From Just A Domain Username (c#)?

Jan 26, 2011

I wish to obtain the domain SID from a user account that has been used to access my web page, but...

In some instances, you dont have access to the HttpContext object to call HttpContext.Current.Request.LogonUserIdentity.User.Value

All the static function is able to accept is a user-name as a string, and a domain-name as a string.

If the domain is left blank, it is amused that the user account name is within the same domain as the IIS server that the process is executing upon. :/

View 2 Replies


Similar Messages:

C# - Sharepoint Retrieving Username Without Domain Or Programmatically Removing Domain

Aug 16, 2010

Im returning the username from sharepoint site as a string. This is done successfully with the below code but I also get the domain with it. How can I only return the username and not the domain either through sharepoint or programmatically removing it? domain/username

[Code]....

View 3 Replies

Security :: How To Get Windows Domain Name And Username

Jan 19, 2011

My intranet web application uses Forms Authentication. How do i get the Active directory domain nameusername of the logged in user. The IIS directory security settings for the app are:

Anonymous User Access : Ticked
Integrated Windows Authentication : Ticked

I tried using the following but to no avail

System.Security.Principal.WindowsIdentity.GetCurrent().Name ----> returns NT AUTHORITYNETWORK SERVICE
Request.LogonUserIdentity.Name -----> returns The username used for anonymous access

ineed to pass this information to an external application for the current user to gain access to the system. Can i untick Anonymous user access in IIS and continue using forms authentication? what are the other options.

View 3 Replies

Security :: Get Domain Username Without Authentication Prompt?

Jul 29, 2010

I have an asp.net c# site that I have setup in IIS 7 and am loading into a sharepoint frame. Sharepoint doesn't prompt for domain credentials but my site does?In IIS I have enabled basic and windows authentication so I can get the domain users username, so if there is a way to get this without prompting that'd be a perfect solution for me.I am using the follwing statement to get username:

System.Web.
HttpContext.Current.User.Identity.Name

View 12 Replies

Security :: Obtain Domain Username Without Requiring Authentication?

Oct 6, 2010

I'm bangin' my head against the wall here. I'm not even sure what I want to do is possible.
I have developed an ASP.NET app that will only be run on my local network (which incorporates a Windows Domain). It's running on IIS 7.5.I want to do this:

[Code]....

My problem is this: If I don't turn off Anonymous Authentication and ASP.NET Impersonation, I don't get the results I'm looking for. (if Anonymous is allowed, I get an empty string returned for username, and if ASP.NET impersonation is allowed, then "username" is always whatever account is associated with impersonation, like "Network Service"). If I turn those off and then turn Windows Authentication on, it works, but only after a dialog box presents itself asking for the Windows Credentials.

What I'm trying to do is NOT require the users to log in. Since they've already logged into the domain when they signed on their computer, I'd like to just allow them access to the ASP.NET application I've written, and identify who they are (based on their previous Windows login) using the line of code above. I don't need them to re-authenticate, because they're already authenticated from their domain login.I can't figure out what I'm doing wrong, or how to accomplish this. It seems the closest I've gotten to what I want so far, is to turn off all authentication EXCEPT for Windows Authentication. It works then, but only if the user first types in his/her username and password again in a dialog box. Is there any way to avoid having them type in their username and password again, but still be able to identify their domain username?

View 3 Replies

Security :: Couldn't Get Strip To Remove The Domain From The Username (as The Format Is Domainnameusername)?

Aug 26, 2010

I've got a literal control to display the username of the user logged into our companies intranet system, originally I had a LoginName control but couldn't get strip to remove the domain from the username (as the format is domainnameusername) so I'm trying it this way.

[Code]....

protected void Page_Load(object sender, System.EventArgs e)

View 7 Replies

Obtaining Information From The Webconfig?

Jul 6, 2010

I have certain information in my webconfig such as the name of the database i am connecting to. However, I would like a situation where my aspx is able to obtain that information as well and display it in a label. Hence, how do I go about doing that.

View 3 Replies

Web Forms :: Obtaining Another Page's Form ID?

Oct 22, 2010

Is it possible to obtain another aspx page's form ID from current page?

StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter ht = new HtmlTextWriter(sw);
form1.RenderControl(ht);

From here, is it possible that form1 is another page's form1 ID?

View 6 Replies

Obtaining Controller Type From String Action?

Dec 24, 2010

In an ASP.NET MVC 2 application, how would I obtain the Type of the controller that would be used, given the information about the route: string action, string controller, object routeValues?

(The routeValues object might look like this new {area="admin"} and route to a controller for a different site area.)

View 1 Replies

Performance - IIS7 Obtaining CPU Usage Per Request?

Feb 17, 2011

I have an asp.net application running on a production server.

The cpu usage on the server is very high, 80-90%.

Each request however does not appear to be taking too long, unless the cpu has peaked at 100%.

I need to obtain some profiling data in order to determine if the high cpu usage is due to a small number of high cpu requests, or, if it is just general high load.

I can add more cores to the machine and also web farm the app but I will need evidence in order to justify any costs and future proofing the performance.

Is there a way of logging to a file the CPU usage for each page request?

View 1 Replies

Obtaining String Result From Other Website Inquiry?

Mar 11, 2010

I have an ASP.net/VB.net website, and want to make an inquiry of another website to obtain particular information for use on my site in string format. For example, I have used the code:

Result01 = "http://api.hostip.info/get_html.php?ip=" + Variable01

which only produces the other website address as a string. However, I want to get the actual result of the inquiry as a string. I have experimented with System.Xml.XmlDocument coding, without any luck. the proper coding to get the results of such an inquiry as a string?

View 6 Replies

C# - Obtaining The Total Page Response Time?

Jun 3, 2010

commonly on say PHP or other web frameworks getting the total response time is easy, just start the timer at the top of the file and stop it at the end. In ASP.Net there is the whole Page Lifecycle bit though so I'm not sure how to do this. I would like for this response time recording to take place in a master page and the response time show up in the footer of pages. What would be the best way of doing this? Is there something built in to ASP.Net for it? Is it even possible to include the OnRender time?

View 3 Replies

Obtaining The SQLParameter For The ID Value Field For Updating Gridview?

May 6, 2010

I am trying to set up a GridViewUpdate, I need to find the Parameter and I am having trouble figuring it out.

How would I go about obtaining the value for "@ID" parameter in order for the user to update the required "TAUpdateDate" field?

[Code]....

View 5 Replies

DataSource Controls :: Obtaining Collation Info From Objects?

Jan 21, 2010

For some reason, some of the fields in our database use a different collation than the default. There doesn't seem to be a pattern as to which fields use the different collations, so I'd like to run a query to find which fields use this collation and change them to the default. Does anyone know how to do this?

View 2 Replies

Forms Data Controls :: Obtaining Values From Gridview?

Apr 27, 2010

I need to get values of all individual cells from the row of a grid view and assign eac one fo them to seperate variables. Should i just access the control values directly from the gridview (the controls are template fields) or is it best to run an sqlq select query for each value i want to retrieve.

View 3 Replies

Security :: Update Username Of Current Logged Username?

Mar 12, 2010

How to update username of current logged username?

View 10 Replies

State Management :: How To Keep Current User Session When Redirected To Sub Domain From Main Domain

Feb 17, 2011

I have also installed SSL on a subdomain. I have put payment page under this sub domain.

View 4 Replies

Windows Authentication - Run Application Under Domain Account Without Joining The Domain?

Sep 28, 2010

My feeling says it's not posible but anyway I am curious if there is at least a workaround for accomplish this.Basically I am working at my client site and my machine is not connected to the domain.What I want to do is running a web application locally under a domain account, and using the webdev server.The webapp uses the default authentication, windows authentication that is.I tried using impersonation with domainuser & password but I got the following error Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.I have to mention that the username and the password are correct.

View 1 Replies

The Trust Relationship Between The Primary Domain And The Trusted Domain Failed

Aug 3, 2010

We have a ASP.NET site that partially depends on forms authentication for login credentials, however the implementation of IPrincipal is completely custom.

But, when running the site on a particular server (which is somewhat semi-hardened when it comes to security), the app crashes when invoking IPrincipal.IsInRole() with the following messsage:

System.SystemException: The trust relationship between the primary domain and the trusted domain failed.

This indicates a communication error between the web-server and the DC, however since our application doesn't at all utilizes Windows authentication, I don't see why it needs to communicate with the DC.

This is my implementation:

[code]...

EDIT:

I was finally enable to reproduce this error on my dev-machine (i revoked my machine from the DC yesterday, but didn't reproduce it until today)

HttpContext.User is actually a WindowsPrincipal by default it seems, and the error in my code was that I only replace it with CustomPrincipal upon login. Hence, unathenticated users still get the WindowsPrincipal which then fails horribly if you have trust issues on your AD.

I tried changing the default principal by invoking this on appstart

AppDomain.CurrentDomain.SetPrincipalPolicy( PrincipalPolicy.NoPrincipal);

But this doesn't seem to kick in. How do I change the default Principal in ASP.NET?

View 1 Replies

Web Forms :: Timeout Period Elapsed Prior To Obtaining A Connection From

Jun 13, 2012

I have the problem of Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

I am opening and closing SqlConnection properly.

View 1 Replies

Security :: Impersonation With Domain Account Without Joining The Domain?

Sep 28, 2010

My feeling says it's not posible but anyway I am curious if there is at least a workaround for accomplish this.Basically I am working at my client site and my machine is not connected to the domain.What I want to do is running a web application locally under a domain account, and using the webdev server.The webapp uses the default authentication, windows authentication that is.I tried using impersonation with domainuser & password but I got the following error Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.I have to mention that the username and the password are correct.

View 2 Replies

How To Autheticate A Domain User From The Web Application Hosted On Another Domain

Jul 28, 2010

I have two domain servers X and Y.My Asp.net Web application is hosted on Domain X.But my scope is required to authorize the user of Domain Y on the Web application hosted on Domain X server.I am using Windows Authetication mode in application

View 2 Replies

State Management :: Sharing Cookies Between Domain / Sub Domain?

Jul 28, 2010

I have a main domain "mydomain.com" and then a sub domain "forums.mydomain.com". If a user visits "forums.mydomain.com" without being logged in, they are redirected to "mydomain.com/login.aspx".

The two scenarios are:

If they are redirected to the login page with "mydomain.com/login.aspx?ReturnUrl=http://forums.mydomain.com", then they are succesfully logged into the forums but NOT the main site.

If they are simply redirected to the login page with "mydomain.com/login.aspx" with no returnUrl, they are correctly logged into both the main site and the forums.

View 2 Replies

Networking - Obtaining Client Computer Name On Local Network In Javascript Web Application?

Jan 27, 2011

I have an asp.net (FW 3.5) web app that runs on an internal network. One specific page needs to "report" in to the web server that it is active and not locked up. I need to be able to run a script (or something) at the client to report the pc's computer name in that report. I cannot find a method that does this. I found several things that would report the WAN IP or host name, but this appears to all be for external facing sites.

View 1 Replies

Forms Data Controls :: Obtaining An Altered Textbox Value From A Grid View?

Feb 23, 2010

I have a gridview with a column of text boxes bound to a value from a database. I should be able to edit the values in each of the text boxes and just print those new values(dont have to update into the database). But my method returns only the old values, not the new values entered into the text boxes.

View 5 Replies







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