TeamSrv
asked on
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?
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"/>
ASKER
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.
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.
ASKER
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!!!
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!!!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.Dir ectoryExis ts("\\serv er\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.
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.Dir
...
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.
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.