开发者

how to open a sharepoint page by providing the user credentials silently

开发者 https://www.devze.com 2023-02-04 13:53 出处:网络
I want to open a native SharePoint 2010 page from my application (for example the Edit Properties page of a document) without the need to enter username/password, but instead to authenticate sil开发者

I want to open a native SharePoint 2010 page from my application (for example the Edit Properties page of a document) without the need to enter username/password, but instead to authenticate sil开发者_Python百科ently (prior or during the page request). is that possible?

In other words, i have a windows forms application, i enter a sharepoint document path and i click on a button, this will open up a windows form with a browser control that will navigate to the native "editform.aspx" sharepoint 2010 page for this document.Is there a way to authenticate the user without the need for him to enter his credentials?

Thanks,


There is no way to pass credentials on the first visit to the SharePoint site. But if you are using an authentication option that allows saving (especially NTML) and the user's browser settings allow for saved passwords, then subsequent logins will be automatic. This would be same experience if they were to open a browser and navigate directly to the EditForm.aspx URL.

In IE you can set the "Automatic Login" settings in the Advanced Options. It treats URLs differently based on the zone, so it would be simpler if your page is in the user's "Intranet Zone".

If you set it up correctly, the first time they user your SharePoint site they will be prompted but every time after that they will be automatically logged in.


YOu could try setting the PreAuthenticate property of the WebRequest (which i assume your using). Although I have to admit to have seen similar questions with mixed results. The logon challenge screen you get is inherent to NTLM:

from the NTLM wiki page:

"First, the client establishes a network path to the server and sends a NEGOTIATE_MESSAGE advertising its capabilities.[11] Next, the server responds with CHALLENGE_MESSAGE which is used to establish the identity of the client.[12] Finally, the client responds to the challenge with a AUTHENTICATE_MESSAGE".

And more about PreAuthenticate (MSDN):

"With the exception of the first request, the PreAuthenticate property indicates whether to send authentication information with subsequent requests without waiting to be challenged by the server. When PreAuthenticate is false, the WebRequest waits for an authentication challenge before sending authentication information."

By doing what Peter suggested (adding the site to your IE's Intranet Zone means your credentials will be cached and webrequest uses these cached requests and honors the settings in IE.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号