MSGraphSDK-NXOAuth2Adapter 0.9.2

MSGraphSDK-NXOAuth2Adapter 0.9.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2016

Maintained by Microsoft Graph, Microsoft Graph SDK Team.



  • By
  • Microsoft Graph

Microsoft Graph iOs SDK Authentication Quick-Start Kit

Overview

This package provides a limited-scope implementation of MSAuthenticationProvider that can be used to jump-start development with the Microsoft Graph SDK for iOs. Its functionality includes:

  • Login via web UI for apps registered on apps.dev.microsoft.com
  • Automatic refreshing of access tokens after login
  • Logout

It is encouraged to fork or use this implementation as a starting point to develop functionality specific to your needs.

1. Installation

2. Getting started

2.1 Register your application

Register your application on apps.dev.microsoft.com.

2.2 Setting your application Id and scopes

  • You can set your application's Client ID and required access scopes on the shared NXOAuth2AuthenticationProvider instance. For example, to get read-write access to a user's calendar and OneDrive files:
[NXOAuth2AuthenticationProvider setClientId:<clientId>
                                     scopes:@[@"https://graph.microsoft.com/Files.ReadWrite",
                                              @"https://graph.microsoft.com/Calendars.ReadWrite"]];
  • More available scopes can be found here.

2.3 Getting an authenticated MSGraphClient object

  • Once you have set the application Id and scopes, you must authenticate the provider and set it on your MSGraphClient instance:
[[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) {
    if (!error) {
        [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]];
        self.client = [MSGraphClient client];
    }
}];
  • The MSGraphClient instance is now ready to make requests against the service!

4. Issues

For known issues, see issues.

5. License

License