365 raisons d’inclure Office365 dans vos apps mobiles (Authentifications, Listes, Agenda dans vos Apps crossplateform)

  • View
    226

  • Download
    0

Embed Size (px)

Text of 365 raisons d’inclure Office365 dans vos apps mobiles (Authentifications, Listes, Agenda dans vos...

  • AMBIENT INTELLIGENCE

    tech days2015

    #mstechdays techdays.microsoft.fr

  • tech.days 2015#mstechdaysSESSION

    Los GaudebertConsultant mobilit

    lois.gaudebert@ai3.fr

    Remi AubertConsultant dveloppement

    remi.aubert@ai3.fr

    AI3Pure Player Microsoft

    Paris

    Nantes

    Toulouse

    Aix-en-Provence

  • tech.days 2015#mstechdaysSESSION

    Lauthentification

    Laccs au calendrier, contacts et mails

    Laccs aux listes

    Laccs aux fichiers

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

    lUX de chaque plateforme

    C# & .Net Framework

    partager du code entre les plateformes

    les performances natives de chaque plateforme

  • tech.days 2015#mstechdaysSESSION

    IHM native

    Avec partage du

    code mtier

  • tech.days 2015#mstechdaysSESSION

    IHM en XAML

    Avec partage du

    code mtier

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

    Mail

    Calendrier

    Contact

    Sites

    Fichiers (OneDrive For Business)

    Utilisateurs

    Organisation

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

    https://portal.office.com/Signup/Signup.aspx?OfferId=C69E7747-2566-4897-8CBA-B998ED3BAB88&DL=DEVELOPERPACK&ali=1#0

  • tech.days 2015#mstechdaysSESSION

    Les mains dans le cambouis :SDK pour Store Apps

  • tech.days 2015#mstechdaysSESSION

    1 2

  • tech.days 2015#mstechdaysSESSION

    3

    4

    _authenticationContext = new AuthenticationContext(authority);var token = await GetTokenHelperAsync(_authenticationContext, AadServiceResourceId);

    var eventsResults = await exchangeClient.Me.Calendar.Events.OrderBy(e => e.Start).ExecuteAsync();

  • tech.days 2015#mstechdaysSESSION

    Les mains dans le cambouis :SDK API pour Xamarin.Forms

  • tech.days 2015#mstechdaysSESSION

    1

    2

  • tech.days 2015#mstechdaysSESSION

    Tous les utilisateurs dun tenant Office 365 sont grs par un tenant Azure Active Directory

    Azure Active Directory va grer la scurisation des accs lAPI Office 365 par dautres applications

  • tech.days 2015#mstechdaysSESSION

    Se noter : Client ID

    Key (client secret)

    Redirect/Sign-On URI

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION 16/02/201

    5

    Librairie utilise pour la gestion de lauthentification

    Gestion des token et des refresh token

    Compatible Azure Active Directory et ADFS

    ADAL est disponible sur diffrentes plateformes

    .NET, Windows Store, Windows Phone, iOS, Android, Node.JS, AngularJS, Java,

    Xamarin

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

    //Cration dun contexteAuthenticationContext = new AuthenticationContext(CommonAuthority);

    //Vrification si un cache existeif (AuthenticationContext.TokenCache.ReadItems().Count() > 0)

    AuthenticationContext = new AuthenticationContext(AuthenticationContext.TokenCache.ReadItems().First().Authority);

    //Authentificationvar authResult = await AuthenticationContext

    .AcquireTokenAsync(ResourceUri, ClientId, ReturnUri, AuthorizationParameters); var token = authResult.AccessToken;

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

    //Obtention du calendriervar Events = await outlookClient.Me.Calendar.Events

    .Where(e => e.Start >= startDate && e.Start < endDate).ExecuteAsync();

    //Ajout dun rendez-vousEvent newEvent = new Event{

    Subject = EventName,Location = location,Start = start, End = end

    };await exchangeClient.Me.Events.AddEventAsync(newEvent);

  • tech.days 2015#mstechdaysSESSION

    //Obtention de contactsvar contactsResults = await exchangeClient.Me.Contacts

    .OrderBy(c => c.DisplayName).ExecuteAsync();

    //Ajout dun contactContact newContact = new Contact{

    GivenName = givenName,Surname = surname, JobTitle = jobTitle, MobilePhone1 = mobilePhone

    }; await exchangeClient.Me.Contacts.AddContactAsync(newContact);

  • tech.days 2015#mstechdaysSESSION

    //Obtention des mailsvar mails = await(from i in outlookClient.Me.Folders.GetById("Inbox").Messages

    orderby i.DateTimeReceived descendingselect i).Skip((pgNo - 1) * pgSize).Take(pgSize).ExecuteAsync();

    //Envoi de mailvar draft = new Message{

    Subject = subject,Body = new ItemBody {ContentType = BodyType.Text,Content = bodyContent},ToRecipients = toRecipients

    };await outlookClient.Me.SendMailAsync(draft, true);

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

    string requestUrl = string.Format("{0}/_api/lists/getbytitle('{1}')/items",SharepointUrl, listName);

    var client = new HttpClient();client.DefaultRequestHeaders.Authorization =

    new AuthenticationHeaderValue("Bearer", Token);HttpResponseMessage response = await client.GetAsync(new Uri(requestUrl));

    var items = DeserializeItem(response)

  • tech.days 2015#mstechdaysSESSION

  • tech.days 2015#mstechdaysSESSION

    //Obtention des fichiersvar filesResults = await sharePointClient.Files.ExecuteAsync();

    //Ajout dun fichierusing (var stream = await sFile.OpenStreamForReadAsync()){

    File newFile = new File{Name = sFile.Name};await sharePointClient.Files.AddItemAsync(newFile);await sharePointClient.Files.GetById(newFile.Id).ToFile().UploadAsync(stream);

    }

  • tech.days 2015#mstechdaysSESSION

    Scnarios dusage

  • tech.days 2015#mstechdaysSESSION

    Situation de mobilit

    Prise de photo

    Golocalisation

    Agenda et Prise de rendez-vous automatique

    Synchronisation hors-ligne

  • tech.days 2015#mstechdaysSESSION

    Documentation

    Personalisation

    Envoi de devis

    Notification pour relance commerciale

  • tech.days 2015#mstechdaysSESSION

    Indicateurs

    Supervision

    Suivi dtaill

  • tech.days 2015#mstechdaysSESSION

    Speakers : lois.gaudebert@ai3.frremi.aubert@ai3.fr

  • tech.days 2015#mstechdaysSESSION

  • 2015 Microsoft Corporation. All rights reserved.

    tech days2015

    #mstechdays techdays.microsoft.fr