与Office 365凭据在线SharePoints

发布于 2025-01-29 11:56:06 字数 666 浏览 3 评论 0原文

我正在尝试通过使用Office 365的加速凭据来从我的.NET应用程序(在这种情况下为VSTO PowerPoint com addin)连接到SharePoint在线。

我可以使用SharePointonLine.csom套件建立我的连接服务器URL和我的凭据。

ClientContext oCtx = new ClientContext(sUrl);
System.Security.SecureString oPassword = new System.Security.SecureString();

foreach (char cPwd in sPassword)
    oPassword.AppendChar(cPwd);

oCtx.Credentials = new SharePointOnlineCredentials(sUsername, oPassword);
oCtx.ExecuteQuery();

但是,我不希望用户在我的应用程序中输入密码。我希望使用Active Office 365凭据。我的研究将我带到了我下载的PNP.Framework软件包。但是,如果没有用户名/密码或clientId和客户端的连接方式,我找不到一种连接的方法。

是否有任何方法可以通过使用存储的Office 365凭据来单个签名来在线? c#或vb.net没关系,对我来说都可以。

非常感谢!

I am trying to connect to a Sharepoint online from my .NET application (in this case VSTO powerpoint COM addin) by using the cached credentials of Office 365.

I can establish my connection using the SharepointOnline.CSOM package and creating a ClientContext by providing the server URL and my credentials.

ClientContext oCtx = new ClientContext(sUrl);
System.Security.SecureString oPassword = new System.Security.SecureString();

foreach (char cPwd in sPassword)
    oPassword.AppendChar(cPwd);

oCtx.Credentials = new SharePointOnlineCredentials(sUsername, oPassword);
oCtx.ExecuteQuery();

However, I do not want the user to enter the password in my application. I would prefer to make use of the active Office 365 credentials. My research brought me to the PnP.Framework package which I downloaded. However I cannot find a way to connect without username/password or the clientID and clientSecret.

Is there any way for a Single Sign On to Sharepoint Online by using stored Office 365 credentials? C# or VB.NET does not matter, both ok for me.

Thank you very much!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文