Download presentation
Presentation is loading. Please wait.
Published byCarrie Keele Modified over 10 years ago
1
Extending SharePoint Online met Windows 8 apps
2
Voorstellen
3
OnderwijsZorgGoede doelen
4
Agenda
5
Doelstelling
7
Demo
8
Authenticatie
10
AD accounts in SharePoint Online
14
Authenticatie
15
Authenticatie - Architectuur https://login.microsoftonline.com/extSTS.srf
16
Authenticatie - Meer informatie
18
Demo
19
Authenticatie - Architectuur https://login.microsoftonline.com/extSTS.srf
20
Authenticatie – Token Request
21
Authenticatie – Token Response
22
Authenticatie - Architectuur https://login.microsoftonline.com/extSTS.srf
23
Authenticatie – Login Request
24
Authenticatie – Login Response
25
Authenticatie - Architectuur https://login.microsoftonline.com/extSTS.srf
26
Authenticatie – Data Request
27
Authenticatie – Data Response
28
Credentials opslaan in de app
29
Password Vault - Store var passwordVault = new PasswordVault(); var passwordCredentials = passwordVault.RetrieveAll(); foreach (var passwordCredential in passwordCredentials) { try { if (passwordCredential.Resource == WinvisionDosyeAccount && passwordCredential.UserName == credentials.Username) { passwordVault.Remove(passwordCredential); } } catch (COMException) { // No password found } } var credential = new PasswordCredential(WinvisionDosyeAccount, credentials.Username, credentials.Password); passwordVault.Add(credential);
30
Password Vault - Retrieve var passwordVault = new PasswordVault(); var credentials = passwordVault.RetrieveAll(); foreach (var passwordCredential in credentials) { try { if (passwordCredential.Resource != WinvisionDosyeAccount) { continue; } passwordCredential.RetrievePassword(); return new Credentials { Username = passwordCredential.UserName, Password = passwordCredential.Password, }; } catch (COMException) { // No password found } }
31
Credential Manager
32
SharePoint interfaces
35
SharePoint lijsten
37
var context = new InnovatieDataContext(new Uri(string.Format("{0}/_vti_bin/listdata.svc", this.settingsService.GetSharePointUri()))); context.SendingRequest += this.ContextOnSendingRequest; var result = new List (); var query = (DataServiceQuery )context.Klanten.Select(c => new Customer { Id = c.Id, Name = c.Titel, AccountManagerId = c.AccountManagerId, ServiceManagerId = c.ServiceManagerId, VerticalId = c.VerticalId, LogoPath = c.Logo, Telephone = c.Telefoonnummer, Website = c.Website, Email = c.Email }); var customers = await query.ExecuteAsync(); result.AddRange(customers); SharePoint lijsten private void ContextOnSendingRequest(object sender, SendingRequestEventArgs sendingRequestEventArgs) { sendingRequestEventArgs.RequestHeaders["Cookie"] = this.settingsService.GetCookieContainer(); }
38
SharePoint lijsten
39
Managed metadata
41
var cookieContainer = new CookieContainer(); cookieContainer.SetCookies(new Uri(this.settingsService.GetSharePointUri()), cookieHeader); var client = new HttpClient(new HttpClientHandler { CookieContainer = cookieContainer }); client.DefaultRequestHeaders.Add("Cookie", cookieHeader); client.DefaultRequestHeaders.Accept.ParseAdd("application/json;odata=verbose"); var response = await client.GetStringAsync( string.Format("{0}/_api/web/lists/getbytitle('Referenties')/Items? $select=Id,Microsoft_x0020_technieken", this.settingsService.GetSharePointUri())); var json = JObject.Parse(response); var managedMetadata = from i in json["d"]["results"].Children().Where(g => g["Microsoft_x0020_technieken"]["results"].Any()) select new { Id = (int)i["Id"], Labels = i["Microsoft_x0020_technieken"]["results"].Values ("Label").ToArray() }; var microsoftTechnologies = managedMetadata.ToDictionary(m => m.Id, m => m.Labels);
42
Bestanden
44
Attachments = c.Bijlagen.Select(b => new Attachment { Title = b.Name, SharePointPath = string.Format("{0}/Lists/{1}/Attachments/{2}/{3}", this.settingsService.GetSharePointUri(), b.EntitySet, b.ItemId, b.Name) }),
45
Bestanden var cookieContainer = new CookieContainer(); cookieContainer.SetCookies(new Uri(this.settingsService.GetSharePointUri()), cookieHeader); var buffer = new byte[] { } using (var client = new HttpClient(new HttpClientHandler { CookieContainer = cookieContainer })) { buffer = await client.GetByteArrayAsync(uri); } var images = await ApplicationData.Current.LocalFolder.CreateFolderAsync(folder, CreationCollisionOption.OpenIfExists); var file = await images.CreateFileAsync(cacheKey, CreationCollisionOption.ReplaceExisting); await FileIO.WriteBytesAsync(file, buffer);
46
“run-with-cookies”
47
Uitdagingen
48
“run-with-cookies”
49
Windows 8 and beyond
50
Andere devices
52
Demo
53
Windows 8.1 app
54
Make universal
55
Windows Phone 8.1
56
Andere devices
58
Demo
59
Android
60
Vragen?
61
THANK YOU
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.