Run Web Application Under A Different User Than The Current User?

Jan 28, 2010

IIS is utilizing the current logged-user's credentials to access an ASP.NET application. Is it possible to create a login page on the application and pass another users credentials, so that particular web app is run under a different user?

View 1 Replies


Similar Messages:

Method Is Only Supported If The User Name Parameter Matches The User Name In The Current Windows Identity?

Jan 30, 2011

get the below error. My application was working fine until I probably modified something, but don't know what.

Server Error in '/' Application.

Method is only supported if the user name parameter matches the user name in the current Windows Identity.

Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.Provider.ProviderException: Method is only supported if the user name parameter matches the user name in the current Windows Identity.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ProviderException: Method is only supported if the user name parameter matches the user name in the current Windows Identity.]
System.Web.Security.WindowsTokenRoleProvider.GetCurrentWindowsIdentityAndCheckName(String userName) +2195661
System.Web.Security.WindowsTokenRoleProvider.GetCurrentTokenAndCheckName(String userName) +36
System.Web.Security.WindowsTokenRoleProvider.GetRolesForUser(String username) +61
System.Web.Security.RolePrincipal.IsInRole(String role) +182....

View 1 Replies

User Controls :: How To Track And Save Time User Uses Application In Windows Forms

May 7, 2015

I did a winforms applicaion using C#. I has 'n' number of forms.I like to track application usage time from user login to application exit.

View 1 Replies

User Controls :: Unable To Get User Input In Required Format In Console Application

Apr 27, 2016

Create a class Employee which will implement the below interface: IEmployee. The application should accept the function to invoke and its parameters from the console in the Format:

[MethodName]:[Parameter1]:[Parameter2]
Ex: SetProperty:Age:44

The implemetation shold have the necessary checks on whether the input is in correct format by handling like FormatException.And the program should be able to continuously accept the input and print corresponding output until the input given as "Exit".

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1

[CODE]..

Issue: I am unable take the user input in the corresponding format.in the above code everytime I have to give the user input in the format "Set:Age:33" but this is not I m looking for .Actually firstly the expected input and output should be given in the format as per the screenshot I have attached.

View 1 Replies

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path

Jan 22, 2011

i have an asp.net project in vs2010 i have a db and table inside the app_data folder, i have created a deployment package and have imported the package into an iis server that is installed on my local mechine.
now i get this error message while trying to preform an insertion.

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed
the connection string is:

Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|survey.mdf;Integrated Security=True;User Instance=True

when running it inside VS2010 it`s working fine.

View 1 Replies

How To Get Current Logged In User Name

Oct 25, 2010

I thought this would be a simple task as I am trying to get the current logged in domain user name. I have the following:

[Code]....

but it ALWAYS returns nothing ""

Is there some configuration in the ASP that I have to do first?

View 3 Replies

Getting The GUID Of The Current User?

Jan 22, 2011

I want to add a user's GUID in with the information I retrieve from a user when they submit a post. How can I get the GUID?

I am using the default authentication system that comes along with an ASP.NET MVC application.

View 2 Replies

C# - To Get Current User Who's Accessing .net App

Mar 24, 2011

To get the current logged in user at the system I use this code:

string opl = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();

I work on an ASP.net app where I need this info. So I've put my app on a server and tried the code above and I get "Network Service" in the string opl. I need to know the current user of the PC who accesses my ASP.net app.

View 2 Replies

Destroy A Session Of Another Than Current User?

Jul 19, 2010

I'm using asp.net 4.0 with asp.net MVC 2.0 and the asp.net membership provider.

I need to terminate a the user session before I delete it. Otherwise if the user is still authenticated the next time it will visit a page null reference exceptions will occur when trying to access the user data and profile.

I get the Session.Abandon() method but what I'm looking for is the same on a user, something like user.AbandonSessions().

View 3 Replies

NopContext.Current.User Is Always Null?

Nov 3, 2010

I've been developing an application based on nopCommerce 1.60. I'm developing on Windows 7 Pro 64bit.

I'm deploying the application to Windows server 2003 R2 (32bit) for staging and this works fine. It works perfectly and exactly like when I run it on the Visual Studio dev server.

I've just deployed the code to the live server for testing in that environment and I've got a real show stopper. NopContext.Current.User is always null!

The live server is Windows 2003 R2 64bit, and this is the only difference I can see. I've been through every page of the site settings in IIS on both servers and made sure every setting is the same, I've also done the same for the Application Pool.

View 2 Replies

HttpContext.Current.User.Identity.Name With And Without Www?

Oct 20, 2010

am writing a web service in vb.net/asp.net 2, that needs user's name. It works fine when the url request is "www.mysite.com" but if any one has logged-in using "mysite.com" without a "www" and goes to the page that calls my web service, The HttpContext.Current.User.Identity.Name gives null. How can I resolve this problem?

View 2 Replies

Security :: Get Current Windows User Username

Apr 26, 2010

Im using forms authentication and im trying to get the current username. I tried using Environment.UserName but I am getting "ASPNET". But if i change my application to windows authentication im getting the true username that is currently logged on. How can I get the true username that is currently logged on in the domain using the forms authentication.

View 3 Replies

Security :: Log Off Current User When He Logs In From A Different Computer?

Sep 26, 2010

I want to log out the user when he (or someone else) logs in from a diferent computer using the same user name.

Basicaly i want to prevent multiple individuals from staying loged in under a single user name by signing out the previous users. Any ideeas about how i can acomplish that ?

View 8 Replies

Security :: How To Ask The Current User Have The Specific Role

Apr 21, 2010

how do i ask if the current user have the specific role ...

like ... if(user is in role)

{
do simthing...
}

View 2 Replies

How To Make The Current User Authenticated Without Login

Feb 22, 2011

How to make the current user Authenticated without login.

In other words, what should I do to get true when I ask User.Identity.IsAuthenticated without login?

Should I create a cookie manually? if so, what's its name, what's its value!!

View 1 Replies

Saving The Login Name As Current User Identity?

Mar 1, 2011

So I'm making a asp.net login. I want the login name that people use to match an id in my SQL database. So that I can retrieve their information. But currently when I use the code below, from which I get the name of the computer I am currently on. However I would like the user Identity to be what they write in the username textbox at the login screen.

If HttpContext.Current.User.Identity.IsAuthenticated Then
Dim userName As String = HttpContext.Current.User.Identity.Name
Response.Write(userName)
End If

So I looked for it on net and I think it might have something to do with my web.config file. As I'm totally new to asp.net I wouldn't know. However here's a part of my Web.config file.

[Code]....

View 3 Replies

C# - Set HttpContext.Current.User From Thread.CurrentPrincipal?

May 17, 2010

I have a security manager in my application that works for both windows and web, the process is simple, just takes the user and pwd and authenticates them against a database then sets the Thread.CurrentPrincipal with a custom principal. For windows applications this works fine, but I have problems with web applications.

After the process of authentication, when I'm trying to set the Current.User to the custom principal from Thread.CurrentPrincipal this last one contains a GenericPrincipal. Am I doing something wrong? This is my code:

Login.aspx

[code]....

View 5 Replies

Web Forms :: Use A Button Which Delete The Current User?

Mar 16, 2010

I want to use a button which delete the current user ...

and i want the after he clicked on the button "delete user" , it will ask him if he's sure ...

there is eny simple or creative way to do it ? ...

View 2 Replies

Security :: Assign A Role To Current User?

May 5, 2010

I am using active directory to authinticate users and then i want to use .net role management to assign roles to users.?

How can i assign a role in code behind to current user. ?

View 4 Replies

Security :: Link To Current Logged In User?

Jan 25, 2011

I wan't to link to the current logged in user with their userid, this is for the user menu. But I don't see why my code dosen't work.Code Behind:

[Code]....

Masterpage:

<asp:LoginView
ID="LoginView1"
runat="server">
<LoggedInTemplate>
<asp:HyperLink
ID="UserProfil"
Text="Profil"
runat="server">Profil</asp:HyperLink>
</LoggedInTemplate>
</asp:LoginView>

View 3 Replies

Get The Current User ID From SQL Statement Using Razor In WebMatrix?

Feb 19, 2011

I'm learning razor syntax, using the startersite in WebMatrix and trying to display some data from a table. I want to select only the data from the logged in user, so in effect want to say

...WHERE UserId =@WebSecurity.CurrentUserId";but that doesn't work.

Using the @0 method doesn't work for me either - I get an 'A parameter is missing. [ Parameter ordinal = 1 ]' error.

Do I have to set a variable then use the @0 / @1 / @whichever way? If so - what's wrong with this code?

@{
//Is the user logged in?
WebSecurity.RequireAuthenticatedUser(); [code]...

View 1 Replies

Security :: Get Current Windows Logon User?

Mar 22, 2010

I have created an intranet site in win 2008 server. Enabled Windows Authentication and disabled Anonymous. I want to get AD logon username(current win logon user).I used HttpContext.Current.User.Identity.Name and also tried User.Identity.NameI am accessing the site from client machine. I am not getting the client's logon user instead getting the server's logon user. But I want client's logon user only.I just want to get username. I dont need any login screens or bla blaWhen I run in my development system(XP), its working fine.
When I deploy to windows 2008 server, I am getting problem(Getting only the server's logon user instead of getting the client's logon user).So, problem in the server settings. So, any settings I need to set to get this worked?I enabled Windows Authentication for my site in IIS management window. Disabled Anonymous authentication.

View 1 Replies

Security :: Find The Current User's ROLE?

Feb 4, 2010

For some reason I couldn't find it anywhere, how do I find the current user's role in vb.net?

View 3 Replies

Security :: The Name 'User' Does Not Exist In The Current Context?

Jan 1, 2010

On my master page i have a link button which should be visible only by Administrator or Supervisors roles.

So in the code behind file of the master page i have put the following code in page load event

[Code]....

but i am getting following error

The name 'User' does not exist in the current context

View 2 Replies

Web Forms :: How To Get The Current Logged In User's Email Address

Mar 18, 2010

How to retrieve the current authenticated logged in user's email address who is accessing the page.

I have managed to do it with users. How to get the current authenticated user's email address if that makes sense.

Here is my aspx code:

[Code]....

and my VB script:

[Code]....

Somebody suggested that I should run a query. If you know the user name accessing the page, surely you can take that information, insert it into a query to find out the email address of the user accessing the page. Sounds great but don't have a clue how to do it.

View 2 Replies







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