.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Prompting for User Credentials

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :SharePoint

I have a 2 web applications configured. One web application is configured for an Intranet and the other is configured for a MySite. These web applications are accessed internally and externally. With the internal applications I'm using integrated windows authentication and with the external applications I'm using basic authentication.

Everything works great except when I access the application externally. I obviously have to authenticate to 2 applications, the Intranet application and MySite application. The issue is when I initially access a page on the Intranet that has user profile pictures from the MySite on it. If there are 6 profile images on the page then I'm asked to authenticate 6 times to the MySite web application. If there is 1 profile image then I only have to authenticate once. Once I leave that page then I don't have to authenticate again.

Why do I have to authenticate for each profile image? Why can't I just authenticate authenticate to the MySite once?

View Complete Post

More Related Resource Links

SP 2010 Keeps prompting for Credentials

Whenever a user tries to edit a document in SP 2010 (Excel, Word, etc), they are able to click edit document and then it loads up into Word or Excel and keeps on nagging you for your domain credentials. If you add your proper credentials it still comes back. I guess the fact that it lets me click the edit document or check out button that my account has proper permissions. I've tried the recommendations of putting the fqdn into my trusted sites. I even get it without using the fqdn (https://sp)   Thanks! This is really bugging me...

Getting user's credentials, who modified a folder



I have made a windows form application which uses a FileSystemWatcher control to watch after changes made in a specific folder.

Because I am talking about a shared folder in an organization, in case a change in a folder is made, I would like to know which user did it.

Is there any possibility to get user's username (the user that made a change in a folder)?


Server 2003 prompting for credentials when connection to Sharepoint document library via UNC

Hi all

I have a sharepoint document library http://mycompany/sites/documentLibrary. When browsing to this site through Internet Explorer on a terminal server I can get to the site without being prompted for a username and password, which is what I want. The site appears as "local intranet"  according to IE.

When browsing to the UNC path \\mycompany\sites\documentLibrary we are being prompted for a username and password. After putting in the credentials the document library displays. I need for the server to be able to access the site via UNC path without being prompted for credentials as we have several in house applications relying on doing so

The funny thing is this was working until recently. What's changed? I have no idea. I have an almost identical terminal server on the same subnet/OS/windows patch level that allows access without prompting for a username or password, and the only thing I had to do for that server was enable the web client service..

Things I have tried so far:

- Checked the Web Client service is enabled, started and set to automatic. Restarted the server just to make sure.
- Added http://mycompany, \\mycompany etc to the trusted zone.
- Set the truste

Reading user credentials in XSL?



I would like to have only a specific number of users allowing to see a specific part of a XML document. Therefore I want to use <xsl:if> like <xsl:if user="Fritz">.

I has to be analyzed who has requested the specific website by using the Negotiate-credentials sent in the header of the HTTP-request. Depending on this, the specific user might or might not see parts of the XML document.

I do not want to use .NET. I just want to focus on XML/XSL.

I also would like to keep my fingers away of writing coder, which would enable entering credentials in a form.

How to do (if possible)?

Could not create Windows user token from the credentials specified

Hi All,

I have developed a web service and installed in a server suucess fully, its working fine there.

I tried to work in another server, But I had some error there in the new server.

I trying to access a network folder, Its accessible for the user which I have mentioned in the web config, But I'm having error.

in the web config
<identity impersonate="true" userName="UserName" password="password"/>

If you have any idea tel me


UserID parameter prompting for credentials


Hi :),

I have a report that is filtered with the User!UserID parameter, and I want to make it prompt the user to enter credentials or at least make the user select his credentials from the drop-down list of the parameter.

Does anyone know how to achieve this?

Thanks in advance,


Web Service credentials after 'Sign in as different user'


I am connecting to exchange using the exchange web service from within Sharepoint Server enterprise edition (2010) code running in an application page





service.Url = 


service.Credentials = System.Net.

Executing SharePoint console application without sharing user credentials


I have a console application, which uses SharePoint object model to do some business operation, therefore it has been deployed on SharePoint server. Without sharing username/pwd, earlier we allow several users to access this console application by providing remote desktop file (.rdp) file. This .rdp file (ver5.1) contains username and encrypted password. With recent version 6.0 of .rdp, it still prompts for password. You may argue that it is due to security constraint.

What is the best approach to allow more users to run this console application without sharing user credentials, without modifying the console application.

Thanks in advance


J Justin


how to add configured credentials user to a specific group


hello guys 

i'm wondering is there a way that i can add my configuration User to a specific role ? 

so i have this in my web.config file 

<forms loginUrl="/Account/Login.aspx">
        <credentials passwordFormat="Clear">
          <user name="Admin@Egycation.com" password="password"/>

<forms loginUrl="/Account/Login.aspx">
        <credentials passwordFormat="Clear">
          <user name="Admin@admin.com&qu

Which method is better to transfer user to there home page after taking there credentials ?



i am developing a login page.After matching there given and actual credentials i have to show there own private page.So which method should i use now.Which is better one ?

Server.Transfer of Response.Redirect ?

How can i access login page's data in the user's home page if i use Server.Transer method without using Session variable ? 

Create SPUser object using user credentials on claims based site.



I would like to create SPSite object and pass user token as an argument to make sure all operations are executed with SharePoint security trimming. Inside SPSite I am reading some file content using File.OpenBinaryStream() method.

I am not sure if there is a way to create SPUser using user credentials. I am able to get SPUser by getting it from SPWeb.AllUsers collection using user login name. However it doesn't work for claims based sites as login name for these users looks like i:0#.w|domain\username. 

Am I allowed to user code like this:

SPUser user = web.AllUsers["i:0#.w|domain\username"];

to get SPUser object? I know that 'w' from 'i:0#.w' string means that it is Windows user. What do other symbols mean? Is there any method which can generate login name from user credentials so I may use it to get SPUser from AllUsers collection?

Possibly there are some other ways to execute code for SPSite under some SharePoint user privileges?

P.S. All my code is running out of SharePoint context. I have tried to user windows impersonation but got Access Denied error.

Thanks beforehand for any help,


How to get Clients Machine User credentials Username and Domain


I am trying to retrieve the loged in userName and Domain of the Clients machine. 

 string IP = (string)Request.ServerVariables["REMOTE_ADDR"];

 string IP = (string)Request.ServerVariables["REMOTE_ADDR"];

   Able to retrieve the Clients Machine IP but need to get the Remote Computer User details.


How to check (login Credentials) user name and password to access sharepoint server 2007 programmati

my issue is...

while user entered his/her Username:xyz
i need to check programmatically either username & password exists ot not in sharepoint server 2007 from windows form application.

and i know how to check username,but i don't know how to check password.

you can check username in below ways..

 SPSite SharepointSiteObj = new SPSite(SiteUrl);
 SPWeb SharepointWebObj = SharepointSiteObj.OpenWeb("/");

 SPUserToken token=SharepointWebObj.AllUsers[userName]

from this i can get user name..




Trying to read User credentials from Active Directory.....



single farm, wss 3.p sp2

webapp1 :- AD authenticated site (just one site collection/site in web-app). AppPool account is myServer\webApp1AppPool

webapp2 : It has one site collection/site and it is Forms-authenticated. AppPool account is myServer\WebApp2AppPool

Now within webapp2 I have a simple ASPX page that accepts user LoginID and on submit in the form, I want to read the USERLOGINID from web-app1. I am getting errors like "access denied" and it is running with SPSecurity.  Apart from checking within sharepoint user collection list (in webapp1) I also check within Active Directory using DirectoryServices.

I am thinking that the myServer\WebApp2AppPool needs to be defined somewhere within webapp1. Is it true?

I also tried SPSecurity by passing user token. For some reason the AppPoolAccount of web-app1 & web-app2 has to be different.

Please suggest.

Extracting user credentials from a service implementation


I am trying to extract the login name from a web service that was authenticated using a custom username validator. It validates ok, but I am unable to extract this info within the service implementation.

So far, I have tried the following:

- return WebOperationContext.Current.IncomingRequest.Headers[HttpRequestHeader.Authorization];
- return OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name;
- return ServiceSecurityContext.Current.WindowsIdentity.Name;
- return Thread.CurrentPrincipal.Identity.Name;

The first works fine if the service is using REST, but returns an empty string with SOAP, so I am thinking the authorization credentials are in the SOAP body rather than the HTTP header in that instance.  (The WCF service supports both REST and SOAP, so I will need a solution that will work with either).

The latter three attempts throw a null reference exception.


stop prompting credentials while opening report manager in SSRS 2008


Hi All,

Can u please help me on how to stop asking the credential while opening report manager/ report server  in SSRS 2008.

I know we can solve this easily in 2005 by setting permission to IIS.  But I don't know how is here?

I searched lot in google but no success.

Kindly help me.

Thanks a lot.

Get Current User Credentials



My Sharepoint and CRM are on different systems but in same domain.

In my webpart i want to pass the credntials of current user logged to sharepoint to my CRM webservice to get some information.

i tried using System.Net.CredentialsCache.DefaultCredntials &System.Net.CredentialsCache.DefaultNetworkCredntials,but its raising 401 Unauthorised error.

How can i get the currentuser credentials

Thx in advance

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend