Skip to content

This sample uses the Office 365 unified endpoint (preview) to fetch user profile data from various services such as Active Directory, SharePoint, Exchange, and OneDrive.

Notifications You must be signed in to change notification settings

W4N4N/O365-Win-Profile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Office 365 Profile sample for Windows

Table of contents

##Introduction

The Office 365 Profile sample for Windows uses the Office 365 unified endpoint (preview) to get user profile data from various services such as Active Directory, SharePoint, and OneDrive.

The first page presents you with a list of users. The second page displays information about any user you choose to view. All of this information, including files shared with the user, the user's email address, hire date, manager, and direct reports, comes from the unified endpoint.

Prerequisites

This sample requires the following:

  • Visual Studio 2013 with Update 4.
  • An Office 365 account. You can sign up for an Office 365 Developer subscription that includes the resources that you need to start building Office 365 apps.
  • A Microsoft Azure tenant to register your application. Azure Active Directory provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: Microsoft Azure.

Important: You will also need to ensure your Azure subscription is bound to your Office 365 tenant. To do this see the Active Directory team's blog post, Creating and Managing Multiple Windows Azure Active Directories. In this post, the Adding a new directory section will explain how to do this. You can also read Set up your Office 365 development environment for more information.

##Register and configure the app

  1. Sign in to the Azure Management Portal, using your Azure AD credentials.
  2. Click Active Directory on the left menu, then select the directory for your Office 365 developer site.
  3. On the top menu, click Applications.
  4. Click Add from the bottom menu.
  5. On the What do you want to do page, click Add an application my organization is developing.
  6. On the Tell us about your application page, specify O365-Win-Profile for the application name and select NATIVE CLIENT APPLICATION for type.
  7. Click the arrow icon on the bottom-right corner of the page.
  8. On the Application information page, specify a Redirect URI, for this example, you can specify http://localhost/profileSample, and then select the checkbox in the lower-right hand corner of the page. Remember this value for the following Build and debug section.
  9. Once the application has been successfully added, you will be taken to the Quick Start page for the application. From here, select Configure in the top menu.
  10. Under permissions to other applications, select Add application. In the dialog box, select the Office 365 unified API (preview) application. After you return to the application configuration page, select the Read items in all site collections, Read users' files, and Access directory as the signed in user permissions.
  11. Copy the value specified for Client ID on the Configure page, and be sure to remember the value you specified for the redirect URI.
  12. Click Save in the bottom menu.

Build and debug

Note: If you see any errors while installing packages during step 3 (for example, Unable to find "Microsoft.IdentityModel.Clients.ActiveDirectory") make sure the local path where you placed the solution is not too long/deep. Moving the solution closer to the root of your drive resolves this issue.

  1. After you've loaded the solution in Visual Studio, configure the sample to use the client id that you registered in Azure Active directory by adding the following key and its corresponding value to the Application.Resources node of the App.xaml file. Office 365 Profile sample`

  2. Open the AuthenticationHelper.cs file and set your redirect URI as the value of this variable. Office 365 Profile sample`

  3. Press F5 to build and debug. Run the solution and sign in with your organizational account to Office 365.

NuGet packages used in the sample

The NuGet packages used in this sample will load automatically when you build the solution. If you want to create an app that uses the unified endpoint, be sure to install the following packages:

  1. Microsoft.IdentityModel.Clients.ActiveDirectory v.2.14
  2. Office 365 unified API client library (preview)
  3. Microsoft.OData.ProxyExtensions v1.0.30

##Questions and comments##

Additional resources

Copyright

Copyright (c) 2015 Microsoft. All rights reserved.

About

This sample uses the Office 365 unified endpoint (preview) to fetch user profile data from various services such as Active Directory, SharePoint, Exchange, and OneDrive.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages