so if a person goes to sharepoint online, logs in, how can I get the cookie that tells sharepoint later on that you are logged in so I can have something else use it and access sharepoint?
1 Answer
If I'm correctly understanding, you are asking how to programmatically get SharePoint auth cookies?
In .net you can use SharePoint Server 2013 Client Components SDK to get cookies see example below:
var login = "admin@***.onmicrosoft.com";
var password = "P@ssw0rd";
var siteUrl = "https://***.sharepoint.com/";
var creds = new SharePointOnlineCredentials(login, password);
var auth = creds.AuthenticateAsync(new Uri(siteUrl), true);
var request = (HttpWebRequest)WebRequest.Create(siteUrl);
request.CookieContainer = auth.Result.CookieContainer;
var result = (HttpWebResponse)request.GetResponse();
-
can you do the same sort of thing is you ended up with a SAML token as well? Does that work the same way or no? I may have the option to get a SAML token from else where but not sure what to do with it afterwards.– BigbaconJul 26, 2014 at 16:16
-
-