Name: O365-Win-Connect
Owner: Office Developer
Description: [DEPRECATED] To see the latest UWP and Xamarin versions of this sample, visit https://github.com/microsoftgraph/uwp-csharp-connect-sample, https://github.com/microsoftgraph/uwp-csharp-connect-rest-sample and https://github.com/microsoftgraph/xamarin-csharp-connect-sample
Created: 2015-03-03 06:07:46.0
Updated: 2017-10-11 23:25:58.0
Pushed: 2018-01-16 17:42:54.0
Size: 769
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
?? (???) (Japanese)
Authentication is the first step for any app that uses an Office 365 service. These three code samples show how to connect a user to an Office 365 tenant inside a Windows Store app, a Windows Phone 8.1 app, and a universal Windows app. Each solution contains a class called AuthenticationHelper that calls the Active Directory Authentication Library (ADAL) to authenticate a user.
The universal Windows app contains shared code files that you can use on both the Windows Store and Windows Phone 8.1 platforms to interact with an Office 365 tenant. The code files that implement the user interfaces for both the Phone and the Windows apps are separate, but the rest of the logic in the universal Windows app is mostly shared.
The interface is essentially the same on both platforms. The images below show what you'll see after you've authenticated in the apps.
Windows Phone 8.1 | Windows Store ————- | ————- |
This sample requires the following:
The configuration steps are the same for all three samples (with one small extra step for the universal Windows app).
Note: If you see any errors while installing packages during step 7 (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.
You can register each app with the Office 365 API Tools for Visual Studio. Be sure to download and install the Office 365 API tools from the Visual Studio Gallery.
The universal Windows app solution contains two projects: O365-Universal-Connect.Windows and O365-Universal-Connect.WindowsPhone. You can perform the registration steps for one project, and the Office 365 assemblies will be added to both projects. However, you'll still need to right-click the other project name and select Add -> Connected Service. When you do this, you'll see this prompt in the Services Manager dialog box:
Click the Yes button. This extra step will make sure that your app gets a redirect URI value in its Azure Active Directory settings. You don't need to know the value of this URI, but it's required for authenticating users in your app.
After you've loaded the solution in Visual Studio, press F5 to build and debug. If you're running a Windows Phone app, the Windows Phone emulator will launch. After the app launches, sign in with your organizational account to Office 365.
We'd love to get your feedback on the O365 Windows Connect project. You can send your questions and suggestions to us in the Issues section of this repository.
Questions about Office 365 development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [Office365] and [API].
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.