We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Identity Impersonate doesnt work with username

TeamSrv
TeamSrv asked
on
Medium Priority
469 Views
Last Modified: 2012-05-06
This one has me puzzled.
If I leave off the username and password to the code below, it works without error.
If I put a user in there that does not have permissions, I get a 403 user doesn't have permissions error.
If I put a user in there that does have permissions, I get a 404 page not found error.
With the user in there, no files are created when I publish it.

I need to specify a user in there to grant certain permissions.
Has anyone seen this before?


<identity impersonate="true" userName="domain\user" password="pass"/>

Open in new window

Comment
Watch Question

Top Expert 2013

Commented:
If I put a user in there that does have permissions, I get a 404 page not found error.
With the user in there, no files are created when I publish it.

I need to specify a user in there to grant certain permissions.
Has anyone seen this before?
What is it that your user trying to do or access? for which page you get 404 error?

Author

Commented:
Currenly nothing comes up on the site.  Even the homepage can not be found.
When I have the user in there and I publish the site, the only files that are created are:

BIN
PrecompiledApp.config

If I do not have a user in there, all of the pages, etc are created in the published location.

Author

Commented:
My goal here is for the site to access a file on a different server.
I am using:
          <authentication mode="Windows"/>
          <identity impersonate="true"/>
In an attempt to get the permissions of whom ever is viewing the page.  
When I run it from the editor (F5 in vs), it works fine, but when I run the published page, I do not have access.
This leads me to believe that it is only taking the permissions if it is running from localhost.

To resolve this, I tried adding a username and password to the identity line.  That is where I am running into trouble.  Instead of publishing all the pages as usual, only the BIN and PrecompiledApp.config files are created.
This also happens when running it from the code.

Am I going about this the right way?  
What piece of the puzzle am I missing?

Any help, comments, or alternate ideas would be great.
Thanks!!!
Top Expert 2013
Commented:
Try to deny anonymous user access ...
1: Disabling anonymous access to your site from IIS
2: adding <authentication> <deny users="?" /> <authentication /> in your web.config
Now I am still not getting why your pages not getting published ? Are you pushing it on your local IIS or some host provider?
If local IIS, I will suggest you to go to your IIS Manager ..Create a Virtual Directory ..Point it to your Directroy where you have your Current VS Project.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
We aren't as concerned about anonymous access.  This will only be running on our Intranet.

Currently Anonymous acces is diabled on the IIS.
For #2, it is not letting me put the deny users inside the authentication.
error:  The element 'authentication' has invalid child element 'deny'.  List of possible elements expected: 'forms, passport'

It is being published to a virtual directory on our IIS server.  Everything publishes there fine until I put the username and password in the idenitity of the web.config.

What my real issue is I have a line in there that says:
If My.Computer.FileSystem.DirectoryExists("\\server\folder") Then
...

Currently it says that directory does not exist (even though it really does).
My Page.User.Identity.Name holds Domain\Username of the person accessing the site
My Environment.UserName holds the windows username of the person accessing the site

I was thinking it is a permissions issue, but I can't seem to find a way around it.

Author

Commented:
Well it seems that some of the issues are stemming from the 'Double Hop'

It still doesn't expain why having a username/password on the indentity would not publish any pages, but I think we are getting closer.
Commented:
It seems that most of the issue was a conflict with Crystal reports and the impersonate.
Apparently they don't play well together.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.