networkcredentials

Window 8 consuming SharePoint REST Interface through FormsAuthentication?

两盒软妹~` 提交于 2019-12-06 11:19:43
I have created a sample Windows 8 Application getting SharePoint 2010 list data using REST Apis like _vti_bin/ListData.svc I am using NetworkCredential to access the list its working fine. How can I achieve the same results using FormsAuthentication? Code for NetworkCredential: context = new CentralAdministrationDataContext(new Uri("http://<SharePoint_URL>/_vti_bin/ListData.svc")); NetworkCredential credentials = new NetworkCredential(); context.UseDefaultCredentials = false; context.Credentials = new NetworkCredential("UserName", "Password"); 来源: https://stackoverflow.com/questions/14645268

Authenticate network credential to access SharePoint site on client object model

旧巷老猫 提交于 2019-12-05 20:16:34
I am working to small app, that is require to bring all users in all groups of given site. I have two sites; SharePoint 2010 running on premisses and SharePoint 2013 online. I am getting credential error... {"The remote server returned an error: (401) Unauthorized."} code. public class Program { static void Main(string[] args) { string _siteURL = "https://intranet.co.uk"; NetworkCredential _myCredentials = new NetworkCredential("user", "password", "https://intranet"); ClientContext _clientContext = new ClientContext(_siteURL); _clientContext.Credentials = _myCredentials; Web _MyWebSite =

How to validate domain credentials (from native code)?

风流意气都作罢 提交于 2019-12-05 04:32:13
i want to validate a set of credentials against the domain controller. e.g.: Username: joel Password: splotchy Domain: STACKOVERFLOW In .NET 3.5 and newer you can use PrincipalContext.ValidateCredentials(username, password) . Otherwise you're in trouble. Following the code in the Microsoft Knowledge Base article How to validate user credentials on Microsoft operating systems , i get to the point where you call AcceptSecurityContext : ss = AcceptSecurityContext( @pAS._hcred, //[in]CredHandle structure phContext, //[in,out]CtxtHandle structure @InBuffDesc, //[in]SecBufferDesc structure 0, //[in

Why does CredentialCache.DefaultCredential contain empty strings for domain, username, and password

放肆的年华 提交于 2019-12-04 04:28:11
问题 Does anyone have any ideas as to why CredentialCache.DefaultCredential would return an ICredential instance with empty strings for domain, username, and password? I'm running a WCF service on IIS 7.5. It works fine on one server but never works on another. I have verified that the IIS application has Windows Authentication enabled.... Here is how it's being used: string url = string.Format("{0}/departments/finance/_vti_bin/listdata.svc", _IntranetAddress); var financeDataContext = new

How to authenticate in an ASP.NET MVC application from a console application

不打扰是莪最后的温柔 提交于 2019-12-03 16:22:53
I have a console application that sends a XML to a MVC application and receive another XML as a response. It works perfectly, but I want to add authorization (for obvious reasons). Here is the code from the console application: using (var wc = new WebClient()) { return GetXmlFromBytes( wc.UploadData("URL", GetBytesFromXml(xmlToSend)) ); } And here is the code from the MVC application: public ActionResult DoSomething() { XElement xml = XElement.Load(new System.IO.StreamReader(Request.InputStream)); var response = InsertDataFromXml(xml); return File(GenerateFileFromResponse, "text/xml", "result

Authenticating ASP.NET MVC user from a WPF application

时光总嘲笑我的痴心妄想 提交于 2019-12-03 14:09:13
问题 How can I authenticate a user (with username and password) of an ASP.NET MVC application? I'm trying to do this using WebClient , passing NetworkCredentials , posting the request to the ASP.NET MVC application from my WPF client. How do I handle this request on the server? How do I get the passed username and password? I'm using forms authentication in the ASP.NET MVC app (the default that is created with a new project). 回答1: Forms authentication works in two steps: The user goes to the LogIn

Why does CredentialCache.DefaultCredential contain empty strings for domain, username, and password

梦想与她 提交于 2019-12-01 21:04:43
Does anyone have any ideas as to why CredentialCache.DefaultCredential would return an ICredential instance with empty strings for domain, username, and password? I'm running a WCF service on IIS 7.5. It works fine on one server but never works on another. I have verified that the IIS application has Windows Authentication enabled.... Here is how it's being used: string url = string.Format("{0}/departments/finance/_vti_bin/listdata.svc", _IntranetAddress); var financeDataContext = new FinanceDataContext(new Uri(url)) { Credentials = CredentialCache.DefaultCredentials }; The NetworkCredential

HtmlAgilityPack and Authentication

谁说胖子不能爱 提交于 2019-12-01 18:10:37
I have a method to get ids and xpaths if given a particular url. How do I pass in the username and password with the request so that I can scrape a url that requires a username and password? using HtmlAgilityPack; _web = new HtmlWeb(); internal Dictionary<string, string> GetidsAndXPaths(string url) { var webidsAndXPaths = new Dictionary<string, string>(); var doc = _web.Load(url); var nodes = doc.DocumentNode.SelectNodes("//*[@id]"); if (nodes == null) return webidsAndXPaths; // code to get all the xpaths and ids Should I use a web request to get the page source and then pass that file into

HtmlAgilityPack and Authentication

岁酱吖の 提交于 2019-12-01 16:34:20
问题 I have a method to get ids and xpaths if given a particular url. How do I pass in the username and password with the request so that I can scrape a url that requires a username and password? using HtmlAgilityPack; _web = new HtmlWeb(); internal Dictionary<string, string> GetidsAndXPaths(string url) { var webidsAndXPaths = new Dictionary<string, string>(); var doc = _web.Load(url); var nodes = doc.DocumentNode.SelectNodes("//*[@id]"); if (nodes == null) return webidsAndXPaths; // code to get

providing domain/user credentials to webview control

和自甴很熟 提交于 2019-11-30 22:22:20
Does anyone know how to provide credentials to a WebView control (or even better - run a Windows 8 Metro style application / WinRT app in the context of a specific domain user?) I've tried following the HttpClient + WebView approach as listed here (http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/05e46a0a-e913-469d-a4a5-4a805dcf158a) but it still prompts the user for credentials, since in the returned content there are links to secured items. I have a NetworkCredential object, and I pretty much want to apply it to every single HTTP call that gets made. Surely someone must