• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

Identity Impersonate doesnt work with username

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

0
TeamSrv
Asked:
TeamSrv
  • 5
  • 2
2 Solutions
 
guru_samiCommented:
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?

0
 
TeamSrvAuthor 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.

0
 
TeamSrvAuthor 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!!!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
guru_samiCommented:
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.
0
 
TeamSrvAuthor 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.

0
 
TeamSrvAuthor 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.
0
 
TeamSrvAuthor Commented:
It seems that most of the issue was a conflict with Crystal reports and the impersonate.
Apparently they don't play well together.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now