Andrew Coates Advanced Windows 10 development with the Office 365 APIs DEV33 5

Embed Size (px)

DESCRIPTION

Introduction Universal App projects Integrating Office 365 APIs Agenda

Citation preview

Andrew Coates Advanced Windows 10 development with the Office 365 APIs DEV33 5 Introduction Universal App projects Integrating Office 365 APIs Agenda Vision z Developer vision Universal Windows Platform A bigger opportunity with one Windows Windows 10 and one app platform One Store + One Dev Center Full Support for Existing Code SDK + Services Adaptive User Interface Natural User Inputs Tuned for every form factor Adaptive UX Tailored experiences Universal Windows 8.1 apps #if WINDOWS_APP ResourceLoader loader = new ResourceLoader(); string about = loader.GetString("SettingsLabel/Text"); string privacy = loader.GetString("PrivacySettings/Text"); string options = loader.GetString("Settings/Text"); ISettingsService settings = container.RegisterSettingsService(); settings.RegisterFlyoutCommand (about); settings.RegisterFlyoutCommand (privacy); settings.RegisterFlyoutCommand (options); #endif No more shared project and specific platforms project No more conditional code Only one Store The Universal Windows Platform is available on every Windows 10 device One binary for every device Its a collection of contracts and extensions When you create an app you target a version of the UWP, not of the operating system Universal Windows Platform SDKs to add specific platform APIs on top of the Universal Windows platform Platform extensions Integrating Office 365 Add Connected Service Registers application in Azure AD and imports necessary assemblies Create a data source XAML makes heavy use of data binding, embrace that paradigm Stateful client Initiate login/consent and store Discovery Context Add Office 365 to Universal App Adding Connected Services Installs NuGet Packages for Office 365 and dependencies Add Connected Service Use Web Account Manager when In most scenarios as this is the default for connected service wizard Your app targets Windows 10 and/or multiple logins (see example) Use Web Authentication Broker when Your app uses AAD and ADFS only Your app targets Win7 and/or iOS/Android (via Xamarin) You need to target authentication flows not supported by WAM OAuth Implementation 21 Web Account Manager var webTokenRequest = new WebTokenRequest(aadAccountProvider, String.Empty, CLIENT_ID, WebTokenRequestPromptType.ForceAuthentication); webTokenRequest.Properties.Add("authority", AUTHORITY); webTokenRequest.Properties.Add("resource", resourceId); webTokenRequestResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest); Web Authentication Broker var authenticationContext = new AuthenticationContext(String.Format(AUTHORITY, TENANT)); var accessToken = (await context.AcquireTokenAsync(resourceId, CLIENT_ID, RETURN_URI)).AccessToken; Authentication Compared Universal App template and Authentication demo Client objects for each service ExchangeClient SharePointClient Constructor takes a token getter function DiscoveryContext wraps an AuthenticationContext AuthenticationContext has methods for getting tokens Office 365 Service Communication Client object constructor example return new ExchangeClient(ExchangeServiceEndpointUri, async () => { return (await _discoveryContext.AuthenticationContext.AcquireTokenSilentAsync( ExchangeServiceResourceId, _discoveryContext.AppIdentity.ClientId, new ActiveDirectory.UserIdentifier( dcr.UserId, UserIdentifierType.UniqueId) ) ).AccessToken; }); Client Object exposes properties Most are IEnumerable collections Designed much like Entity Framework Client == DataContext IEnumerable entities Includes common CRUD operations Office 365 UWP App demo Jordan Knight See your day in a single glance Day Bar Office 365 UWP + serial port access Arduino Led strip (and some other bits and bobs) Make(er) one yourself! Find all the instructions, links and components (more links) at https://github.com/jakkaj/daybar Its pretty simple Some basic wiring Some C code (but not much!) Some C# Quick run through Jordan Knight Day Bar code and links Find all the instructions, links and components (more links) at https://github.com/jakkaj/daybar Arduino VS plugin:Office 365 Windows starter: https://github.com/OfficeDev/O365-Windows-Starthttps://github.com/OfficeDev/O365-Windows-Start Remember: you need an Office 365 developer account (free with Bizspark etc.) Introduction Universal App projects Integrating Office 365 APIs Summary PRD322 A Day in an Office Developers Life Yesterday at 09:45. Itll be on Channel9 DEV 326 Word, Excel, PowerPoint Add-ins Yesterday at 17:00. Itll be on Channel9 DEV327 Outlook Add-ins. Yesterday at 18:30. Itll be on Channel9 DEV334 Windows 10 Development with O365 APIs This was it. You want MORE? Getting Started with APIs Mobile dev Code Samples Mobile dev Training videos & hands on labs Office 365 API documentation @OfficeDev StartStart Continue your Ignite learning path Visit Microsoft Virtual Academy for free online training visit https://www.microsoftvirtualacademy.com Visit Channel 9 to access a wide range of Microsoft training and event recordings https://channel9.msdn.com/ Head to the TechNet Eval Centre to download trials of the latest Microsoft products Andrew Coates Advanced Windows 10 development with the Office 365 APIs DEV33 5