UWP app中的Sharepoint身份验证 [英] Sharepoint authenticaion in uwp app

查看:161
本文介绍了UWP app中的Sharepoint身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UWP中工作,无法获得Cookie响应以进行共享点身份验证.以前,我是在Windows应用程序上工作的,我在这里实现了它,但是相同的代码不适用于UWP应用程序.
感谢您的帮助.

i am working in UWP and could not able to get cookies response for sharepoint authentication. Priviously i was worked on windows app i achieved it here but the same code not working for UWP app.
Any help is appreciated.

这是我尝试过的.

    private async Task<SPOAuthCookies> GetSPOAuthCookies(SamlSecurityToken stsToken)
        {
 
            Uri siteUri = this.spSiteUrl;
            Uri wsSigninUrl = new Uri(String.Format("{0}://{1}/{2}", siteUri.Scheme, siteUri.Authority, spowssigninUri));
            var clientHandler = new HttpClientHandler();
 
            await HttpUtility.SendHttpRequest(
                wsSigninUrl,
                HttpMethod.Post,
                new MemoryStream(stsToken.BinarySecurityToken),
                "application/x-www-form-urlencoded",
                clientHandler);
 
            SPOAuthCookies spoAuthCookies = new SPOAuthCookies();
            spoAuthCookies.FedAuth = clientHandler.CookieContainer.GetCookies(wsSigninUrl)["FedAuth"].Value;
            spoAuthCookies.RtFA = clientHandler.CookieContainer.GetCookies(wsSigninUrl)["rtFA"].Value;
            spoAuthCookies.Expires = stsToken.Expires;
            spoAuthCookies.Host = wsSigninUrl;
 
            return spoAuthCookies;
        }

我的代码从此处中断

推荐答案

没有用户名和密码,因此如何获取身份验证?

在开发Windows应用程序时,它可能会自动进行身份验证.


这篇关于UWP app中的Sharepoint身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆